The
jQuery stop() method in jQuery is used to stop animations or effects before it is finished.
This method works on all type of animation like sliding, fading, and custom animations.
Syntax:
$(selector).stop(stopAll, goToEnd);
Example-1: Stop sliding animation.
Output:
Before clicking on the GeeksForGeeks:
👁 Image
After clicking on the GeeksForGeeks and not clicking on Button:
👁 Image
After clicking on the GeeksForGeeks and click on Button:
👁 Image
Example-2: Stop sliding from left to right.
Output:
Before clicking on the Start:
👁 Image
After clicking on the Start and not clicking on Stop:
👁 Image
After clicking on the Start and clicking on Stop:
👁 Image