「Javascript/jqueryライブラリ/touchSwipe.js」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→ダウンロード&インストール) |
(→動作サンプル) |
||
行25: | 行25: | ||
</script> | </script> | ||
</head> | </head> | ||
− | <body id="test"> | + | <body id="test">ここをスワイプ</body> |
</html> | </html> |
2016年5月23日 (月) 18:43時点における版
touchSwipeとは
jqueryのドロワータッチ対応ライブラリ
公式ページ
http://labs.rampinteractive.co.uk/touchSwipe/demos/index.html
ダウンロード&インストール
wget https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/archive/master.zip unzip master
動作サンプル
<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript" src="/assets/js/TouchSwipe-Jquery-Plugin-master/jquery.touchSwipe.min.js"></script> <script> $(function() { $("#test").swipe( { swipe:function(event, direction, distance, duration, fingerCount, fingerData) { $(this).text("You swiped " + direction );-- } }); $("#test").swipe( {fingers:2} ); }); </script> </head> <body id="test">ここをスワイプ</body> </html>