We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
不要这样做,大多数浏览器都会阻止这种情况发生,这是有充分理由的。
您希望我在两个显示器上扩展您的电子邮件客户端,这样您就无法工作了吗?为什么网络浏览器应该被区别对待?有些决定是由用户决定的,这绝对就是其中之一。
用户对浏览网页有期望,但这样做会打破这些期望。如果我在 Chrome 中打开 20 个选项卡(而且经常在多个窗口上打开),我不希望您的网站调整其他 19 个选项卡的大小。然而,它确实让我想用沙拉叉追捕您并将其插入您的眼睛。
Don't do this, most browsers prevent this from happening, for good reason.
Would you like me to come stretch your email client across both monitors so you can't work? Why should a web browser be treated any differently? Some decisions are for the user this is definitely one of them.
The users has expectations browsing the web, doing things like this breaks those expectations. If I had 20 tabs open in chrome (and often do, on several windows), I don't want your site to resize the other 19. It does however make me want to hunt you down with a salad fork and stab it in your eye.
尝试使用 window.resizeto(width, height) 函数
Try using the
window.resizeto(width, height)
function