在JavaScript中跨浏览器调整大小的浏览器窗口 [英] cross-browser resize browser window in JavaScript

查看:165
本文介绍了在JavaScript中跨浏览器调整大小的浏览器窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够用JavaScript来调整浏览器窗口。我不想使用jQuery,较小的code中的好,但在所有的主流浏览器包括Chrome工作。

I would like to be able to resize the browser window with JavaScript. I don't want to use jQuery, and the smaller the code the better, but it has to work in all of the major browsers including Chrome.

任何解决方案?

感谢您的帮助!

P.S。这个问题被打上了标签应合并,但我不知道怎么办。

P.S. The tags that this question was tagged with should be combined but I don't know how.

浏览器-----------一样 - > web浏览器

browser -----------same as--> webbrowser

跨浏览器----一样 - >浏览器兼容性

cross-browser----same as--> browser compatibility

推荐答案

window.resizeTo(宽度,高度);

您可能面临的问题是现代浏览器都可以prevent您在设置无法调整窗口大小。周围有没有办法。

The problem you may face is modern day browsers can prevent you in the settings to not be able to resize the window. There is no way around that.

Chrome浏览器不会允许它。 不会修复的Bug

Chrome will not allow it. Won't Fix Bug

IE是基于安全区域

这篇关于在JavaScript中跨浏览器调整大小的浏览器窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆