Back to Scripts page
Click in the text area below, select all and copy to grab the script
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Butterfly</title> <script type="text/javascript" language="Javascript"> <!-- Hide script from older browsers firstTime = true if (document.getElementById) { stdBrowser = true } else { stdBrowser = false } function moveIt() { if (firstTime) { if (stdBrowser) { moverObj = document.getElementById("mover").style moverObj.top = "5px" moverObj.left = "5px" } if (document.all) { maxHeight = document.body.clientHeight-40 maxWidth = document.body.clientWidth-40 } else { maxHeight = window.innerHeight-40 maxWidth = window.innerWidth-40 } firstTime = false } if (stdBrowser) { topPos = parseInt(moverObj.top) leftPos = parseInt(moverObj.left) } else { topPos = document.mover.top leftPos = document.mover.left } chgXBy = Math.floor(Math.random() * 10) if ((halfChance() || topPos >= maxHeight) && topPos > 5) { topPos -= chgXBy } else { topPos += chgXBy } chgYBy = Math.floor(Math.random() * 10) if ((halfChance() || leftPos >= maxWidth) && leftPos > 5) { leftPos -= chgYBy } else { leftPos += chgYBy } if (stdBrowser) { moverObj.top = topPos + "px" moverObj.left = leftPos + "px" } else { document.mover.top = topPos document.mover.left = leftPos } setTimeout("moveIt()",20) } function halfChance() { if (Math.random() < .5) { return true } return false } // End hiding script --> </script> <style type="text/css"> <!-- #mover {position: absolute; left: 5px; top: 5px;} --> </style> </head> <body bgcolor="#FFFFFF" onload="moveIt()"> <div id="mover"> <img src="images/butterfly.gif" width="32" height="32" alt="Butterfly" /> </div> </body> </html>
Images:
(Some scripts do not have associated images)