Javascripts > Javascript Windows > Windows Earthquake
Script Title: Windows Earthquake
Description: Makes the window shake around for a few seconds.
Example: Available
Copy the following code into your <HEAD></HEAD> tags.<script language=javascript> <!-- function earthquake() { for (var i=0;i<=10;i++) { code(i); } for (var i=10;i>=0;i--) { code(i); } } function code(i) { var z1=Math.round(Math.random()); var z2=Math.round(Math.random()); if (z1==0) var x=-i; else x=i; if (z2==0) var y=-i; else y=i; for (var c=0;c<=80;c++) { if(c==0 && i>5) c=50; self.moveBy(x,y); self.moveBy(-x,-y); } } --> </script>
Copy the following code between the <BODY></BODY> tags of your html page.<center><input type=button value=Start onClick=earthquake()><center>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email