Introduction to jQuery
JQuery Syntax
JQuery Effects
JQuery HTML
JQuery Traversing
The jQuery stop() method is used to stop animations or effects before it is finished.
.stop()
MethodThe .stop()
method is used to halt ongoing animations or effects immediately before they finish. It applies to:
.slideDown()
, .slideUp()
, .slideToggle()
.fadeIn()
, .fadeOut()
, .fadeToggle()
, .fadeTo()
.animate({})
$(selector).stop(stopAll, goToEnd);
stopAll
(optional):true
clears the animation queue.
false
(default) keeps queued animations.
goToEnd
(optional): true
jumps to the final state of the current animation.
false
(default) leaves it where it is.
So, by default, the stop()
method kills the current animation being performed on the selected element.
The following example demonstrates the stop()
method, with no parameters:
Try it yourself