Previous use of long press on the company project, also used JQ mobile, as if with the back end of the conflict, it is useless.
This is a long press of the current DOM operation.
Layout
<ulID= "lis"> <Li><span></span></Li> <Li><span></span></Li> <Li><span></span></Li> <Li><span></span></Li> <Li><span></span></Li></ul>
Style
#lis Li{width:50px;Height:50px;Border:1px solid #000;margin:0 10px 15px;float: Left;List-style-type:None;position:relative;}#lis Li Span{width:10px;Height:10px;Background-color:Red;position:Absolute; Right:-5px;Top:-5px;Display:None;Z-index:5;}
Js
$(function(){ $(' #lis Li '). On ({touchstart:function(e) {var_this = $ ( This)//gets the current valueTimeoutevent = SetTimeout (function() {timeoutevent= 0; _this.children (' span '). Show ();//operation's current value},800); }, Touchmove:function() {cleartimeout (timeoutevent); Timeoutevent= 0; } }) $(' #lis Li Span '). On (' click ',function(){ $( This). Parent (). remove (); })});
Mobile End long press event action