How do you stop an animation in jQuery?

Use .stop() method.

$("#box").slideDown(5000);
$("#stopBtn").click(function(){
  $("#box").stop(); // stops animation
});

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *