开发者

Javascript browser shake on Firefox

Is it possible to use Javascript to 开发者_如何学Cshake Firefox browser?

I find a script that works on Safari but that script doesn't seem to work on Firefox. http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser

Thanks,

Tee


Because I use NoScript, this code would not execute unless I allowed it on my browser. But be warned, if you shake my browser window, I will probably blacklist 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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜