jQuery Methods: stop()

By: Dusty Arlia
Published on Tuesday, December 24, 2013, 01:48 PM
Last Updated on Saturday, July 11, 2015 at 9:09 PM
Total Updates: 4

The stop() jQuery method stops any currently executing animations on the selected elements.

The stop() method takes two optional boolean arguments. The first one controls the queue, while the second controls the current animation.

If the first argument is true the animation queue will be cleared and the current animation will stop. If the first argument is false (the default) or omitted, then the queued animations are not canceled.

If you pass true as the second argument, the current CSS values of the current animation get set to their target values. If you pass false as the second argument (the default) or omit it, the current CSS values of the current animation stay at their current values.

Here is an example:

$(".thumbnail").bind({
    mouseover: function() {$(this).stop().fadeTo(500,1.0);},
    mouseout: function() {$(this).stop().fadeTo(500,0.5);}
});

Comments:

Ad: