Scriptaculous Effect Tween


/ Published in: JavaScript
Save to your folder(s)

HTML+Javascript


Copy this code and paste it in your HTML
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Sample</title>
  6. <script type="text/javascript" src="js/prototype.js"></script>
  7. <script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
  8. <script type="text/javascript">
  9. //
  10. Event.observe(window, 'load', main);
  11. //
  12. function main() {
  13. new Effect.Tween('foo', 10, 100, { duration: 2, afterFinish: function() { alert("Game Over"); } }, function(p) { this.innerHTML = 'Countdown: '+p } );
  14. }
  15. </script>
  16. </head>
  17. <body>
  18. <div id="foo"></div>
  19. </body>
  20. </html>

URL: http://www.undolog.com/2008/03/20/scriptaculous-effecttween-come-funziona/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.