var timeOutEvent=0;
$(function(){
$(".item-content").on({
touchstart: function(e){
// console.log(this);
var that = this;
timeOutEvent = setTimeout(function () {
//长按触发事件
timeOutEvent = 0;
console.log(that.id);
$.confirm('确定删除该通知?', function () {
$.alert('删除成功');
});
},500);
// e.preventDefault();
},
touchmove: function(){
clearTimeout(timeOutEvent);
timeOutEvent = 0;
},
touchend: function(){
clearTimeout(timeOutEvent);
// return false;
}
})
});
移动端长按事件
最新推荐文章于 2024-03-19 21:16:55 发布