手机触摸之touch事件
在PC上有点击事件(click),有划上去事件(onmouseover),有离开事件(onmouseout),在手机上也可以用PC上的交互,但是会有半秒的延迟,所以新推出了手机交互事件(touch).
touch事件有几种:
(1)ontouchstart:按下手指
(2)ontouchmove:移动手指
(3)ontouchend:移开手指
使用方法
通过addEventlistener("touchstart",fn,false); //绑定事件
注意:用PC浏览器需要模拟手机,正常无效