Q:

Finish a currently running animation using jquery

0

Finish a currently running animation using jquery

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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();
    });

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now