English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Window screenY property

JavaScript Window Object

screenYA read-only property that returns the vertical distance, in pixels, from the top border of the user's browser window to the top border of the screen.

The screenY property is a newerscreenTopAlias of the property.

Syntax:

window.screenY
var win = window.open('', 'popupWindow');
win.document.write("<p>This \u00A0"39;popupWindow'
win.document.write("<br>ScreenX: \u00A0" + win.screenX);
win.document.write("<br>ScreenY: \u00A0" + win.screenY + "</p>
Test and see‹/›

Note: The screenX and screenY properties are equal to the screenLeft and screenTop properties.

Browser compatibility

All browsers fully support the screenY property:

property
screenYIt isIt isIt isIt isIt is

Technical Details

Return Value:Number of CSS pixels from the top edge of the browser viewport to the top of the screen

More Examples

Return the x and y coordinates of the new window relative to the screen:

var win = window.open("", "popupWindow", "left=500, top=350, width=300, height=200");
win.document.write("<p>This \u00A0"39;popupWindow'
win.document.write("<br>ScreenX: \u00A0" + win.screenX);
win.document.write("<br>ScreenY: \u00A0" + win.screenY + "</p>
Test and see‹/›

Related References

Reference: Window (Window)window.screenX property

Reference: Window (Window)window.screenTop property

Reference: Window (Window)window.screenLeft property

JavaScript Window Object