Q:

Stop an Animation using jquery

0

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

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