移动端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 事件(例如, 创建了太多的触控点)。

猜你喜欢

转载自www.cnblogs.com/xiongxiaolong/p/10330271.html
今日推荐