ScreenDetailed: thuộc tính top
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 top của giao diện ScreenDetailed là một số đại diện cho tọa độ y (cạnh trên) của toàn bộ vùng màn hình 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 cạnh trên thực sự, bỏ qua 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ể đặt trong những vùng đó; để lấy tọa độ trên của vùng màn hình có thể đặt cửa sổ, hãy sử dụng ScreenDetailed.availTop.
Note:
Trong Firefox, một triển khai không chuẩn của thuộc tính top có sẵn trên giao diện Screen. 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 absolute top value of the first screen
const screen1Top = screenDetails.screens[0].top;
Ví dụ không chuẩn
// Available in Firefox
// Return the absolute top value of the current screen
const screenTop = window.screen.top;
Thông số kỹ thuật
| Specification |
|---|
| Window Management> # ref-for-dom-screendetailed-top> |