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

查看:33
本文介绍了在 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 和其他浏览器中有 outerWidthouterHeight.

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"支持的独立于浏览器的解决方案,请参阅this链接

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天全站免登陆