Mega Code Archive

 
Categories / JavaScript Tutorial / JQuery
 

Stop an animation

< html>   <head>     <script type="text/javascript" src="js/jquery-1.3.2.js"></script>     <script type="text/javascript">         $(document).ready(function(){                          $("#go").click(function(){               $("div").animate({left: '+=1000px'}, 20000);             });                      $("#stop").click(function(){               $("div").stop();             });                  });     </script>   <style>   div {      position: absolute;    }   </style>        </head>   <body>     <body>          <button id="go">Go</button>           <button id="stop">STOP!</button>         <div>asdf</div>     </body> </html>