javascript代码: $.swipe=function(opt){ var o = $.extend({ mainSelector:"", swipeLeft:function(e,v){}, swipeRight:function(e,v){}, swipeEnds:function(v,e){} }, opt || {}); var startX=0,startY=0; var obj={ touchStart: functio…
源码: // Zepto.js // (c) 2010-2015 Thomas Fuchs // Zepto.js may be freely distributed under the MIT license. ; (function($) { var touch = {}, touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, longTapDelay = 750, gesture function swipeDirection(x1…
Touch事件在用户触摸屏幕(页面)时触发 1.jquery mobile tap tap事件在用户敲击某个元素时触发 $("p").on("tap",fucntion(){ $(this).hide(); }); 2.jquery mobile taphold taphold事件在用户敲击某个元素并保持一秒时被触发 3.jquery mobile swipeleft swipeleft 事件在用户在某个元素上从左滑动超过30px时被触发 $("p&quo…
判断移动端还是pc端 function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); var flag = true; for (var v = 0; v…