Posted By

jerryvig on 05/26/12


Tagged

jquery animation


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

BrockSamsom


Simple jQuery Animation Test


 / Published in: jQuery
 

A simple example of using jQuery animate for an animation effect.

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <!--A simple example of using jQuery animate for an animation effect -->
  5. <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script>
  6. <script type="text/javascript">
  7. $(document).ready(function(){
  8. $("#clickme").click(function(){
  9. $(this).animate({
  10. left: '+=100',
  11. top: '+=100'
  12. },500,function(){});
  13. });
  14. });
  15. </script>
  16. </head>
  17. <body>
  18. <div id="clickme" align="center" style="background-color:red;position:absolute;left:0;top:0;width:100px;">Click here</div>
  19. </body></html>

Report this snippet  

You need to login to post a comment.