Screen.height
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.
Screen.height
は読み取り専用プロパティで、画面の高さをピクセル数で返します。
値
数値です。
例
js
if (window.screen.availHeight !== window.screen.height) {
// 何かが画面を占拠している
}
メモ
このプロパティによって与えられる高さのすべてがウィンドウに利用できるわけではないことに注意してください。タスクバーなどのウィジェットや、 OS と統合された他の特殊なアプリケーションウィンドウ(例えば、ウィンドウの上で追加のツールバーのように動作するように最小化された Spinner プレイヤーなど)は、ブラウザーウィンドウや他のアプリケーションに利用可能な空間の量を減らすことがあります。
Internet Explorer は、画面の高さを報告する際に拡大率の設定を考慮します。拡大率が 100% に設定されている場合のみ、実際の画面の高さを返します。
仕様書
Specification |
---|
CSSOM View Module # dom-screen-height |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
height |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.