jquery-touchswipe 介绍
TouchSwipe一款专门为移动设备设计的jquery 插件 ,用于监听单个和多个手指触摸等事件。
jquery-touchswipe 特点:
1、监听滑动的4个方向:上、下、左、右;2、监听多个手指收缩还是外张;3、 支持 单手指或双手指触摸事件;4、 支持 单击事件touchSwipe对象和它的子对象;5、可定义临界值和最大时间来判断手势的实际滑动;6、滑动事件有4个触发点:“开始”,“移动”,“结束”和“取消”;7、结束事件可以在触摸释放或是达到临界值时触发;8、允许手指刷和 页面 滚屏;9、可 禁止 用户 通过输入元素(如:按钮、表单、文本框等)触发事件;?jquery-touchswipe 安装
1、npm
npm install jquery-touchswipe --save
2、Bower
bower install jquery-touchswipe --save
3、将压缩 文件 添加 到你的项目里
<script src="js/jquery.touchSwipe.min.js" type="text/JavaScript"></script>
4、使用
$(function() {
$("#test").swipe( {
//Generic swipe handler for all directions
swipe:function(event,direction, dis tance,duration,fingerCount,fingerData) {
$(this).text("You swiped " + direction );
}
});
//Set some options later
$("#test").swipe( {fingers:2} );
});
网站地址 : http://labs.rampinteractive.co.uk/touchSwipe/demos/index.html
GitHub: https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
网站描述: 用于监听单个和多个手指触摸等事件的jquery 插件
jquery-touchswipe官方网站
官方网站: http://labs.rampinteractive.co.uk/touchSwipe/demos/index.html
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。
查看更多关于jquery-touchswipe的详细内容...