Javascript shake browser on Firefox

Can I use Javascript to shake a Firefox browser?
I find a script that works in Safari, but that the script does not seem to work in Firefox. http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser

Thank you
Tee

+3
source share
1 answer

Since I use NoScript , this code will not execute unless I have enabled it in my browser. But be careful if you shake my browser window, I will probably close your site and send flying monkeys to devour your soul.

Here is an implementation that works ... use with caution:

<html>
    <head>
        <script language="javaScript">
            function shakescreen(n)
            {
                if (parent.moveBy)
                {
                    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);
                        }
                    }
                }
            }
        </script>
    </head>
    <body>
        <form>
            <input type="button" onClick="shakescreen(4)" value="Shake Browser Window">
        </form>
    </body>
</html>
+8
source

Source: https://habr.com/ru/post/1794297/


All Articles