[X]

The Earthquake Script

windows and alerts 1998 dead

Scripts could grab the visitor's browser window and shake it around the screen, so of course everyone did.

In 2026: Dead. Browsers stopped honouring moveTo and moveBy for anything but small single-tab popups the script itself opened, because a page rearranging your desktop stopped being funny around the tenth ad that did it. The calls succeed silently and nothing moves.

Where it came from: Netscape JavaScript 1.2 window positioning, 1997. A staple of the free script archives as a welcome effect. MDN

<script language="JavaScript">
// Shake the visitor's ENTIRE BROWSER WINDOW. A greeting, at the time.
function earthquake() {
  for (var i = 0; i < 10; i++) {
    window.moveBy(12, 0);  window.moveBy(0, 12);
    window.moveBy(-12, 0); window.moveBy(0, -12);
  }
  document.getElementById("r").innerHTML =
      "Forty moveBy calls issued. Did anything move?";
}
</script>

<button onclick="earthquake()">Welcome, visitor!</button>
<p id="r"></p>
sandboxed demo · breaks nothing but itselfrestart

More in windows and alerts

all 9 in windows and alerts › · the whole library ›