Window: screenY property


目录

The screenY read-only property of the Window interface returns the vertical distance, in CSS pixels, from the top border of the user's browser window to the top side of the screen.

NOTE: Window.screenTop is an alias of the older screenY property. screenTop was originally supported only in IE but was introduced everywhere due to popularity.

Value

A number equal to the number of CSS pixels from the top edge of the browser window to the top edge of the screen.

Examples

In our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. In this example we are using Window.screenLeft/Window.screenTop plus Window.requestAnimationFrame() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved.

See Window.screenLeft for more information.

Specifications

Browser compatibility

See also


版本号 #3
由 壳壳虫 创建于 2026-10-31 03:27:53 UTC
由 cocobook-sync 更新于 2026-11-04 17:35:19 UTC