window.innerHeight ie8替代 [英] window.innerHeight ie8 alternative

查看:150
本文介绍了window.innerHeight ie8替代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些依赖于 window.innerHeight 的计算。但正如我发现这在IE9之前的任何IE中都不可用。我所看到的所有其他选项甚至都没有接近我使用 window.innerHeight 时获得的数字。

I have some calculations that rely on window.innerHeight. But as I have found out this is not available in any IE before IE9. All the other options I have looked at don't even come close to the figure I get when I use window.innerHeight.

有没有人可以解决?

推荐答案

您可能想尝试:

document.documentElement.clientHeight;

或者可以使用 jQuery的 .height() 方法:

Or can use jQuery's .height() method:

$(window).height();

这篇关于window.innerHeight ie8替代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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