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

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

问题描述

我希望能够使用 JavaScript 调整浏览器窗口的大小.我不想使用 jQuery,代码越小越好,但它必须适用于包括 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. The tags that this question was tagged with should be combined but I don't know how.

浏览器-----------同-->网页浏览器

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

跨浏览器----同-->浏览器兼容性

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

推荐答案

window.resizeTo( width,高度);

您可能面临的问题是现代浏览器可能会阻止您在设置中无法调整窗口大小.没有办法解决这个问题.

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 不允许.不会修复错误

Chrome will not allow it. Won't Fix Bug

IE 基于安全区域

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

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