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-browserThanks,
TeeBecause 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>
精彩评论