Screen.availHeight

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.

概述

返回浏览器窗口在屏幕上可占用的垂直空间,即最大高度。

语法

iAvail = window.screen.availHeight

示例

js
if (window.screen.availHeight !== window.screen.height) {
  // something's in the way!
  // use available to size window
}

规范

Specification
CSSOM View Module
# dom-screen-availheight

浏览器兼容性

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
availHeight

Legend

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

Full support
Full support
See implementation notes.