Zepto 的 'swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown' 触摸事件在安卓4.4系统中除chrome + 火狐 以外的 浏览器 + 微信 都无效javascript
zepto 滑动插件有bug的。。。html
并且这个 bug 做者不肯意修,理由是:我特么没有安卓设备java
I also can't get all about 'swipe' to work correctly on Android devices. I use a Nexus 4 ,xiaomi 1S 。android
初步解决方案github
百度 GMU上拉滑动实例页面chrome
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() })