Usage and difference between jq stop () and is (: animated) (detailed description), jqanimated
Stop (true, true ):
It indicates that the animation of the matching element is stopped, the animation is redirected to the final state, and the animation queue is cleared. It is often used to solve the problem that the animation effect is inconsistent with the cursor action because the cursor moves too quickly!
JQuery stop () method
The jQuery stop () method is used to stop an animation or effect before they are completed.
The stop () method applies to all jQuery effect functions, including sliding, fade-in and fade-out, and custom animations.
Syntax
$ (Selector). stop (stopAll, goToEnd); The Optional stopAll parameter specifies whether to clear the animation queue. The default value is false, that is, only the animation that stops the activity allows any animations that are placed in the queue to be executed backward.
The optional goToEnd parameter specifies whether the current animation is completed immediately. The default value is false.
Therefore, by default, stop () clears the current animation specified on the selected element.
The following example demonstrates the stop () method without parameters:
$("#stop").click(function(){ $("#panel").stop(); });
: Is (": animated"): The animated is the jQ selector that selects all animation elements.
It is used to determine whether an element is animated. It is often used to "continuously click the top or bottom button and only respond to the user's first click action.
if(!$("#lunbolist li").is(":animated")){ $("#lunbolist li").filter(".on").hide(); $("#lunbolist li").eq(currentindex).fadeIn(100).addClass("on").siblings().removeClass("on"); $(this).addClass("on").siblings().removeClass("on"); }
The usage and difference between the above jq stop () and is (: animated) are all the content shared by the editor. I hope you can give me a reference, we also hope that you can support the customer's home.