美文网首页
移动端touch事件总结

移动端touch事件总结

作者: yanghanbin_it | 来源:发表于2017-06-09 10:23 被阅读0次

    HTML5触摸事件(touchstart、touchmove和touchend)

    touchstart事件:当手指触摸屏幕时候触发,即使已经有一个手指放在屏幕上也会触发。

    touchmove事件:当手指在屏幕上滑动的时候连续地触发。在这个事件发生期间,调用preventDefault()事件可以阻止滚动。

    touchend事件:当手指从屏幕上离开的时候触发。

    touchcancel事件:当系统停止跟踪触摸的时候触发。关于这个事件的确切出发时间,文档中并没有具体说明,咱们只能去猜测了。

    touch事件和click事件的区别

    在移动端,手指点击一个元素,会经过:touchstart --> touchmove --> touchend --> click。

    相关文章

      网友评论

          本文标题:移动端touch事件总结

          本文链接:https://www.haomeiwen.com/subject/mnctqxtx.html