ScreenDetailed: top 屬性
ScreenDetailed 介面中只讀的 top 屬性是一個數字,表示相對於 多螢幕起點,在作業系統虛擬屏幕布局中的整個螢幕區域的 y 座標(頂部邊緣)。
這等於螢幕的真實頂部邊緣,忽略了繪製在螢幕頂部的任何作業系統 UI 元素。視窗無法放置在這些區域;要獲取視窗可以放置的螢幕區域的頂部座標,請使用 ScreenDetailed.availTop。
值
一個數字。
示例
視窗管理 API 示例
js
// Available in browsers that support the Window Management API
const screenDetails = await window.getScreenDetails();
// Return the absolute top value of the first screen
const screen1Top = screenDetails.screens[0].top;
非標準示例
js
// Available in Firefox
// Return the absolute top value of the current screen
const screenTop = window.screen.top;
規範
| 規範 |
|---|
| 視窗管理 # ref-for-dom-screendetailed-top |
瀏覽器相容性
載入中…