移动端事件总结

移动端事件
1.事件顺序
一般事件顺序:touchstart > touchmove > touchend > scroll
(a).点击(各设备统一):
touchstart > touchend
(b).swipe(设备不同,执行顺序不同):
ipad ===> touchstart > touchmove多次 > touchend > scroll(惯性滚动结束)
ios ===> touchstart > touchmove多次 > touchend > scroll
Android ===> touchstart > touchmove > touchcancel >scroll多次
2.事件对象
每个触摸事件会生成一个event对象。
targetTouches/touches:当前屏幕上所有手指的列表
changedTouches:当前事件的手指列表
touch对象包含以下属性:
clentX/clientY:触摸点相对浏览器窗口的位置
pageX/pageY:触摸点相当于页面的位置
screenX/screenY:触摸点相对于屏幕的位置
target:当前的DOM元素

移动端页面 滚动结束 判断
JS移动客户端–触屏滑动事件

此条目发表在移动端分类目录。将固定链接加入收藏夹。

发表评论

邮箱地址不会被公开。 必填项已用*标注