Switch to full style
JQuery Examples
Post a reply

Stop animation in JQuery

Mon Dec 31, 2012 12:12 am

Stop animation in JQuery:
Code:

<html>
<
head>
<
title>Stop animatation in JQuery</title>

<!--
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
 Note you can download the JQuery package instead of using Google version. --> 
<script src="jquery-1.8.3.js"></script>
<script> 
$(document).ready(function(){
   
         // slides or frames
       $("button.animation").click(function(){
         var div=$("div.to");
         
         div.animate({left:'+=100px',opacity:'0.8'},5000);
  });
     // stop animation
    $("button.stop").click(function(){
    $("div.to").stop();
  });
      
  
   
});


</script> 
</head>
 
<body>
 
<p>Start and stop</p>
 

<div class="to" style="background:#45F233;height:58px;width:58px;left:120px;position:absolute;">
CM
</div>
 
 
<button class="animation">Start Animation</button><br/>
<button class="stop" >Stop</button><br/> 
</body>
</html>





Post a reply
  Related Posts  to : Stop animation in JQuery
 stop watch     -  
 Poseidon Infosoft: One Stop Solution for all your IT needs.     -  
 Poseidon Infosoft: One Stop Solution for all your IT needs.     -  
 animation using Photoshop     -  
 Simple animation     -  
 Sprite Animation     -  
 cloud animation     -  
 create Animation in java     -  
 How to use Javascript animation to change the size of a div?     -  
 Drawing and rotating Tetrahedron with animation     -  

Topic Tags

JQuery Animate