移动端android touchend事件长按或滑动时不触发


解决方式

  • touchmove事件或touchstart阻止默认行为
    e.preventDefault();

长按好像还是不行

  • 增加touchcancel事件,和touchend处理同样的逻辑

touchcancel--MDN

The touchcancel event is fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created).

当触控点被特定的实现方式打乱时触发 touchcancel 事件(例如, 创建了太多的触控点)。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM