Stop an Animation using jquery
HTML Code :
<!DOCTYPE html> <html> <head> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <meta charset="utf-8"> <title>Stop an animation</title> </head> <body> <button id="btn1">Start Animate</button> <button id="btn2">Stop Animate</button> <div id="box" style="background:#5858FA;height:100px;width:100px;margin:6px;"></div> </body> </html>
JavaScript Code :
$("#btn1").click(function(){ $("div").animate({height: 250}, 1200); $("div").animate({width: 250}, 1200); $("div").animate({height: 75}, 1200); $("div").animate({width: 75}, 1200); }); $("#btn2").click(function(){ $("div").clearQueue(); });
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
HTML Code :
JavaScript Code :