ScreenDetailed: thuộc tính availTop
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Thuộc tính chỉ đọc availTop của giao diện ScreenDetailed là một số đại diện cho tọa độ y (cạnh trên) của vùng màn hình khả dụng bên trong bố cục màn hình ảo của OS, tương đối so với điểm gốc đa màn hình.
Giá trị này bằng với thuộc tính ScreenDetailed.top, cộng thêm chiều cao của bất kỳ phần tử giao diện OS nào được vẽ ở phía trên màn hình. Các cửa sổ không thể được đặt trong những vùng đó, vì vậy availTop hữu ích để xác định ranh giới trên của vùng thực sự có thể mở hoặc đặt cửa sổ.
Note:
Một triển khai không chuẩn của thuộc tính availTop có sẵn trên giao diện Screen trong tất cả các trình duyệt. Xem Ví dụ không chuẩn bên dưới để biết chi tiết sử dụng.
Giá trị
Một số.
Ví dụ
>Ví dụ Window Management API
// Available in browsers that support the Window Management API
const screenDetails = await window.getScreenDetails();
// Return the availTop value of the first screen
const screen1AvailTop = screenDetails.screens[0].availTop;
Ví dụ không chuẩn
// Available in all browsers
// Return the availTop value of the current screen
const screenAvailTop = window.screen.availTop;
Thông số kỹ thuật
| Specification |
|---|
| Window Management> # ref-for-dom-screendetailed-availtop> |