Shake the website screen using Java Script


According to me, you can shake the screen using JavaScript. Add the following code in the <head> section. Call the shake screen from the onclick button.



<html>

<head>

<title>Shake Screen</title>

<SCRIPT LANGUAGE="JavaScript1.2">

<!-- Begin

netscape = (navigator.appName == "Netscape");

n4 = netscape && (parseInt(navigator.appVersion) >= 4);

explorer = (navigator.appName == "Microsoft Internet Explorer");

ie4 = explorer && (parseInt(navigator.appVersion) >= 4);

 

function shake_screen(n) {

if (n4 || ie4) {

for (a = 10; a > 0; a--) {

for (c = n; c > 0; c--) {

self.moveBy(0,a);

self.moveBy(a,0);

self.moveBy(0,-a);

self.moveBy(-a,0);

         }

      }

   }

}

// End -->

</script>

</head>

<body>

<!-- a1 --><center>

<form>

Click on the Shake screen Button<br>

<br>

<input type=button onClick="shake_screen(2)" value="shake_screen Screen">

</form>

</center><!-- -->

</body>

</html>





Added on December 21, 2007 Comment
}