移動端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