jQuery Stop Animations


jQuery stop() Method

The jQuery stop() method is used to stop animation or effect before it is completed.

The stop() method applies to all jQuery effect functions, including sliding, blurring and custom animation.

Syntax:


$(selector).stop(stopAll,goToEnd);

Optional configuration parameterAll determines whether the animation line should also be deleted or not. The default is false, meaning only active animation will be stopped, allowing any online animation to be performed afterwards.

The optional goToEnd parameter determines whether or not to complete the current animation immediately. The default is false.

Therefore, by default, the stop() method kills the current animation performed in the selected component.

The following example illustrates the default stop(), with no parameters:


Example
$("#stop").click(function(){
  $("#panel").stop();
});