Window.outerHeight

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Window.outerHeight 只读属性返回整个浏览器窗口的高度(以像素为单位),包括侧边栏(如果存在)、窗口镶边(window chrome)和窗口调正边框(window resizing border/handle)。

备注

要改变窗口的大小,请查看 window.resizeBy()window.resizeTo()

要获取窗口的内层高度,即页面被显示区域的高度,可查看 window.innerHeight

图像示例

下面的示意图展示了 outerHeightinnerHeight 两者的不同。

innerHeight 和 outerHeight

规范

Specification
CSSOM View Module
# dom-window-outerheight

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
outerHeight

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

参见