Window Shake Effect

Grab the user's attention with force. This script loops through coordinates to physically vibrate the popup window on the screen.

Since modern browsers lock the main window, click below to open a "Shakeable" popup.

Copy the Script

<script>
function shake(n) {
    if (parent.moveBy) {
        // Shake loop
        for (i = 10; i > 0; i--) {
            for (j = n; j > 0; j--) {
                parent.moveBy(0, i);
                parent.moveBy(i, 0);
                parent.moveBy(0, -i);
                parent.moveBy(-i, 0);
            }
        }
    }
}
// Trigger shake with intensity level 3
shake(3);
</script>

Frequently Asked Questions

Chrome and most modern browsers disable 'window.moveBy' on the main tab. This script generally only works on popup windows that you have opened via JavaScript.

Yes. You can increase the pixel values in the 'moveBy' function (e.g., change 5 to 20) for a more violent shake, or reduce it for a subtle vibration.

No. It is purely a visual effect within the browser software and does not affect the physical hardware.