English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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.
All browsers fully support the screenY property:
property | |||||
screenY | It is | It is | It is | It is | It is |
Return Value: | Number of CSS pixels from the top edge of the browser viewport to the top of the screen |
---|
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‹/›
Reference: Window (Window)window.screenX property
Reference: Window (Window)window.screenTop property
Reference: Window (Window)window.screenLeft property