2022-05-21 JQuery长按事件 JQuery长按事件 $(".text").on({ touchstart: function(e) { var oSpan = e.currentTarget.lastElementChild // 长按事件触发 timeOutEvent = setTimeout(function() { timeOutEvent = 0; console.log('你长按了'); }, 500); }, touchmove: function() { clearTimeout(timeOutEvent); timeOutEvent = 0; }, touchend: function() { clearTimeout(timeOutEvent); if (timeOutEvent != 0) { console.log('你点击了'); ... 2022年05月21日 885 阅读 0 评论