Window screenTop property

Definition and usage

screenTop Property returns the y (vertical) position of the window relative to the screen.

See also:

screenLeft property

screenX property

screenY property

Example

Return the window's x and y coordinates:

let x = window.screenLeft;
let y = window.screenTop;

Try it yourself

Syntax

window.screenTop

Return value

Type Description
Number Window relative to screen y(Vertical) position, in pixels.

Browser support

All browsers support window.screenTop

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
支持 11 支持 支持 支持 支持

window.screenTop 在版本 64(2018 年 11 月)之前的 Firefox 中不受支持。