Library - JQuery

Back to Course

Lesson Description

Lession - #563 JQuery Stop()

The jQuery stop(>
method is used to prevent an animation or effect before it's finished. The stop(>
technique works for all jQuery effect functions, including sliding, fading and custom animations.



Parameter Description
stopAll Optional.
A boolean value specifying whether or not or not to stop the queued animations as well. Default is false

goToEnd Optional.
A boolean value specifying whether or not to complete all animations immediately. Default is false


 <title> jQuery Example</title>  
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">  
{ $("#start">
{ $("div">
.animate({height: 300}, 3000>
; $("div">
.animate({width: 300}, 3000>
; }>
; $("#stop">
{ $("div">
; }>
; }>
; </script> </head> <body> <p> <button id="start">Start Animation</button> <button id="stop">Stop Current Animation</button> </p> <div style="background:blue;height:100px;width:100px"></div> </body> </html>
Try it here