标签:
https://github.com/madrobby/zepto/issues/315#issuecomment-8386027
touch.js
.on(‘touchmove MSPointerMove pointermove‘, function(e){ if((_isPointerType = isPointerEventType(e, ‘move‘)) && !isPrimaryTouch(e)) return firstTouch = _isPointerType ? e : e.touches[0] cancelLongTap() touch.x2 = firstTouch.pageX touch.y2 = firstTouch.pageY deltaX += Math.abs(touch.x1 - touch.x2) deltaY += Math.abs(touch.y1 - touch.y2) /** * 修复 android 4.4 swipe 事件 * https://github.com/madrobby/zepto/issues/315#issuecomment-8386027 */ if (touch.x2 && Math.abs(touch.x1 - touch.x2) > 10) e.preventDefault() })
标签:
原文地址:http://www.cnblogs.com/huanlei/p/4494227.html