When we swipe the phone, if the Li or div tag can be clicked, then on the mobile side give the user an effect
/*ID is the ID of the UL on the add effect Li, or the ID of the current DIV*/functiondotouchpublic (ID) {SetTimeout (function(){ varobj=document.getElementById (ID); Touchpublic.tagultagdiv (obj); },300); };varTouchpublic={tagultagdiv:function(obj) {varObjall; /*if the object is UL, add an event to Li, otherwise add an event to the Div current object*/ if(obj.tagname== "UL") {Objall=Obj.childnodes; }Else{Objall=obj; } touchpublic.touchmoveendif (Objall); }, /*Li does the delegate event, on the delegate event in JQ*/Touchmoveendif:function(obj) {$ (obj). On (' Touchstart ',function() {Touchpublic.touchobjstart ( This, "Objrowover"); }) /*Touch Swipe, E.preventdefault (); Is to let end trigger*/$ (obj). On (' Touchmove ',function() {Touchpublic.touchobjend ( This, "Objrowover"); }); /*Touch Away*/$ (obj). On (' Touchend ',function() {Touchpublic.touchobjend ( This, "Objrowover"); }); }, Touchobjstart:function(That,color) {$ (that). addclass (color); }, Touchobjend:function(that,color) {if($ (that). attr (' class ') = =color) {$ (that). Removeclass (color); } }}
Mobile phone-side touchstart,touchmove,touchend event to optimize user access to an effect that can be clicked on Li