Finish a currently running 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>Finish a currently running animation</title> </head> <body> <p> <button id="start">Start Animation</button> <button id="finish">Finish Animation</button> </p> <div style="background:#8942D5;height:100px;width:100px"></div> </body> </html>
JavaScript Code :
$("#start").click(function(){ $("div").animate({height: 275}, 4000); $("div").animate({width: 275}, 4000); }); $("#finish").click(function(){ $("div").finish(); });
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 :