为什么window.outerHeight!==$(窗口).outerHeight()



控制台日志:

window.outerHeight
> 1080
$(window).height()
> 1008
$(window).outerHeight()
> 1008

我真正想要的是window.outerHeight的跨浏览器解决方案,我认为jQuery已经具备了这一点。为什么它提供了不同的车窗外部高度?在我看来,jQuery是在计算视口大小吗?

我关心的原因主要是因为我不认为IE8有"window.outerHeight"

对于IE8,请尝试使用:

document.body.offsetHeight

在此处找到:https://stackoverflow.com/a/14077446/864385
不确定这种方法是否真的有效以及它的准确性。

最新更新