touch

touch事件touch是针对触屏手机上的触摸事件。现今大多数触屏手机webkit内核提供了touch事件的监听,让开发者可以获取用户触摸屏幕时的一些信息。

其中包括:touchstart,touchmove,touchend,touchcancel 这四个事件

touchstart,touchmove,touchend事件可以类比于mousedown,mouseover
mouseup的触发。

touchstart : 当手指触摸到屏幕会触发;

touchmove : 当手指在屏幕上移动时,会触发;

touchend : 当手指离开屏幕时,会触发;

touchcancel许多人不知道它在什么时候会被触发而忽略它,其实当你的手指还没有离开屏幕时,有系统级的操作发生时就会触发touchcancel,例如alert和confirm弹框,又或者是android系统的功能弹窗。

例如:

这4个事件的触发顺序为:

touchstart -> touchmove
-> …… -> touchmove ->touchend

原文地址:https://www.cnblogs.com/lnn-713/p/5355904.html