[英]How do I change the browser width/height in jQuery?
Can't figure this out for the life of me. 无法想象我的生活。 Google is no help either. 谷歌也没有帮助。 I'm sure its super easy. 我确信它非常容易。
It's not that easy. 它不是那么容易。 For one thing, this is generally something you should not do. 首先,这通常是你不应该做的事情。 Firefox for example has an option to disable Javascript from resizing the browser. 例如,Firefox可以选择禁用Javascript来调整浏览器的大小。 It's considered anything from a security risk to just a plain annoyanace. 它被认为是从安全风险到简单烦恼的任何事情。
Resizing the browser puts you in the same bucket as poker and "She's waiting for you!" 调整浏览器大小可以让你和扑克一样,“她在等你!” sites. 站点。 Just don't do it. 只是不要这样做。
If you need a window of a specific size, open one of that size with the options to window.open()
. 如果需要特定大小的窗口,请使用window.open()
选项打开其中一个大小。
Having read all that if you still must do it, use window.resizeTo()
. 阅读完所有内容后,如果仍然必须这样做,请使用window.resizeTo()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.