H5长按事件


 1 let timeOutEvent = 0
 2 $(function () {
 3   $('#debug').on({
 4     touchstart: function (e) {
 5       setTimeout(function () {
 6         longPress()
 7       }, 10000)
 8       e.preventDefault()
 9     },
10     touchmove: function () {
11       clearTimeout(timeOutEvent)
12       timeOutEvent = 0
13     },
14     touchend: function () {
15       clearTimeout(timeOutEvent)
16       return false
17     }
18   })
19 })
20 
21 /* eslint-disable no-unused-vars */
22 function longPress () {
23   timeOutEvent = 0
24   router.go('about')
25 }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM