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