Loading Please Wait...

Logo Lynxsia IT Solutions

jQuery Effects Stop

JQ Effects Stop

The jQuery stop() method is used to stop animations or effects before it is finished.

The stop() Method

The stop() method is used to stop an animation or effect before it is finished.

The stop() method works for all jQuery effect functions, including sliding, fading and custom animations.

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

The optional stopAll parameter specifies whether also the animation queue should be cleared or not. Default is false, which means that only the active animation will be stopped, allowing any queued animations to be performed afterwards.

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

So, by default, the stop() method kills the current animation being performed on the selected element.

The following example demonstrates the stop() method, with no parameters:

					 
        
          $("#stop").click(function(){
            $("#panel").stop();
          });
        
      
The stop() method With Parameters
					 
        
          // Action 1: start the animation
          $("#start").click(function(){
            $("div").animate({left: '100px'}, 5000);
            $("div").animate({fontSize: '3em'}, 5000);
          });
  
          // Action 2: stop the animation
          $("#stop").click(function(){
            $("div").stop();
          });

          // Action 3: stop all the animation
          $("#stopAll").click(function(){
            $("div").stop(true);
          });

          // Action 4: stop but finish the animation
          $("#stopButFinish").click(function(){
            $("div").stop(true, true);
          }); 
        
      

The "start" button starts the animation.

The "stop" button stops the current active animation, but allows the queued animations to be performed afterwards.

The "stopAll" button stops the current active animation and clears the animation queue; so all animations on the element is stopped.

The "stopButFinish" rushes through the current active animation, then it stops.

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved