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

浏览器兼容性

BCD tables only load in the browser