移动端长按删除事件

 //长按删除事件
        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;
                }
            })
        });
原文地址:https://www.cnblogs.com/wjunwei/p/6491250.html