jQuery Stop  Tutorial

jQuery - Stop

jQuery stop() method is very useful for stopping the currently running animation before the finishing of the selected element animation.

General Syntax of animation:

$(selector).stop(stopAll,goToEnd);
  • selector: It denoted the selected HTML element.
  • stopAll: It is an optional parameter that has a default value that is false which indicates that only stop the current animation and the rest of the animations that exist in the queue will run afterward.
  • goToEnd: It is also an optional parameter that has by default value is false and it denotes whether or not to complete the current animation immediately.

Source Code

Try it now

Let us use both optional parameters of the stop() method and set it to true.

Source Code

Try it now