MDN self-hosted library · e01.org

ScreenDetailed: top property

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

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;