在IE中获取整个浏览器的宽度/高度? [英] Getting the width/height of the entire browser in IE?

查看:210
本文介绍了在IE中获取整个浏览器的宽度/高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道Javascript调用什么来获取整个浏览器窗口的宽度/高度(包括导航,菜单等?)

Does anybody here know what the Javascript call is to get the width/height of the entire browser window (including nav, menu, etc?)

我知道那里在FF,Safari和其他浏览器中是 outerWidth outerHeight

I know there is outerWidth, outerHeight in FF, Safari and other browsers.

推荐答案

这也可能会有所帮助,具体取决于你想要完成的工作:

This also could be helpful, depending on what exactly you're trying to accomplish:

window.moveTo(0 ,0);
window.resizeTo(screen.width,screen.height);
var navButtonsEtcHeight = screen.height - window.innerHeight;
var navButtonsEtcWidth = screen.width - window.innerWidth;

window.moveTo(0,0); window.resizeTo(screen.width,screen.height); var navButtonsEtcHeight = screen.height - window.innerHeight; var navButtonsEtcWidth = screen.width - window.innerWidth;

注意:对于window.innerHeight支持的独立于浏览器的解决方案,请参阅此链接

Note: For browser-independent solution to "window.innerHeight" support, see this link

然后你有您正在寻找的答案 - 请注意,非全屏用户的缺点是看到他们的窗口首先在屏幕上反弹。

Then you have the answer you're looking for -- mind you, with the downside of the non-fullscreen user seeing their window bounce around the screen first.

这篇关于在IE中获取整个浏览器的宽度/高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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