开发者

Javascript window resize doesn't work in Safari but does in Firefox

I have this basic javascript code: window.resizeTo(1000,800) set to run when the page loads and it works perfectly in Fire开发者_运维技巧fox but not in Safari.

Thanks in advance!


The browser blocks this, quite intentionally. Please don't try to resize the user's window, this will only lead to them hunting you down with a salad fork.

Keep in mind that most browsers by default use tabs, what gives your site the right to resize my other tabs? When you think about it from the users' point of view, you should see why browser makers have intentionally started blocking this unwanted behavior (at least at the top/tab level, resize what you want inside your own page, e.g. an <iframe>).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜