The JQuery Stop () method is used to stop animations or effects before they are finished.
The Stop () method applies to all JQuery effect functions, including sliding, fading, and custom animations.
Grammar:
1 $ (selector). Stop (stopall,gotoend);
The optional StopAll parameter specifies whether the animation queue should be cleared. The default is false, which stops only active animations, allowing any queued animation to be executed backwards.
The optional gotoend parameter specifies whether to complete the current animation immediately. The default is False.
Therefore, by default, stop () clears the current animation specified on the selected element.
Example:
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <Scriptsrc= "Jquery-2.2.0.min.js">5 </Script>6 <Script> 7 $ (document). Ready (function(){8 $("#start"). Click (function(){9 $("Div"). Animate ({left:'100px'}, the);Ten $("Div"). Animate ({fontSize:'3em'}, the); One }); A - $("#stop"). Click (function(){ - $("Div"). Stop (); the }); - - $("#stop2"). Click (function(){ - $("Div"). Stop (true); + }); - + $("#stop3"). Click (function(){ A $("Div"). Stop (true,true); at }); - - }); - </Script> - </Head> - <Body> in - <ButtonID= "Start">Begin</Button> to <ButtonID= "Stop">Stop it</Button> + <ButtonID= "Stop2">Stop all</Button> - <ButtonID= "STOP3">Stop but to complete</Button> the <P><b>Start</b>The button will start the animation.</P> * <P><b>Stop</b>The button stops the currently active animation, but allows the queued animation to be executed forward.</P> $ <P><b>"Stop All"</b>button to stop the currently active animation and empty the animation queue, so all animations on the element will stop.</P>Panax Notoginseng <P><b>"Stop but do it"</b>Immediately completes the animation of the current activity and then stops.</P> - the <Divstyle= "background: #98bf21; height:100px;width:200px;position:absolute;">HELLO</Div> + A </Body> the </HTML>
JQuery Stop Animation-jquery Stop ()