只需要引入jquery.touchSwipe.js就可以
下面是实例
//滑动事件
$("#main_scroll_id").swipe( {
swipeStatus:function(event, phase, direction, distance, duration,fingerCount) {
console.log("你用"+fingerCount+"个手指以"+duration+"秒的速度向" + direction + "滑动了" +distance+ "像素 " +"你在"+phase+"中");
},
swipe:function(event, direction, distance, duration, fingerCount) {
console.log("你用"+fingerCount+"个手指以"+duration+"秒的速度向" + direction + "滑动了" +distance+ "像素 " );
},
});
官方网站
http://labs.rampinteractive.co.uk/touchSwipe/demos/
下载地址
https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
本文为仙士可原创文章,转载无需和我联系,但请注明来自仙士可博客www.php20.cn