Javascripts > Misc Javascripts > Shaking Window
Script Title: Shaking Window
Description: Use this javascript to create a button which when clicked will cause the browser window to shake. Not incredibly useful but fun.
Example: Available
Copy the following code into your <HEAD></HEAD> tags.<script language="javascript" type="text/javascript"> var speed =100; //You can change this value var repeatCount = 10;//You can change this value var spread = 10; //You can change this value var i = 0; function Vibrate() { spread = - spread; window.moveBy(spread, spread); i++; if (i >= repeatCount) { window.clearInterval(Go); i = 0; } } function DoIt() { Go = window.setInterval(Vibrate, speed); } </script>
Copy the following code between the <BODY></BODY> tags of your html page.<form> <input type="button" value="ClickMe!" onclick="DoIt();"> </form>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email