/ Published in: JavaScript
HTML+Javascript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Sample</title> <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript" src="js/scriptaculous.js?load=effects"></script> <script type="text/javascript"> // Event.observe(window, 'load', main); // function main() { new Effect.Tween('foo', 10, 100, { duration: 2, afterFinish: function() { alert("Game Over"); } }, function(p) { this.innerHTML = 'Countdown: '+p } ); } </script> </head> <body> <div id="foo"></div> </body> </html>
URL: http://www.undolog.com/2008/03/20/scriptaculous-effecttween-come-funziona/