Window.pageYOffset (Property)

The amount that a window has been scrolled downwards.


JavaScript - 1.2
Netscape - 4.0
Opera - 5.0
Property/method value type:Number primitive
JavaScript syntax:NmyWindow.pageYOffset

This read-only integer value tells you how far the window content has been scrolled in the vertical direction.

Note that Netscape Navigator is somewhat picky about whether you can even scroll the content of a window. It insists on the scrollbars being visible even though the content may not cause them to be active.

Netscape Navigator 4 will let you scroll layers and Netscape 6 provides sufficient DOM standardized CSS positioning controls to satisfy your requirements.

In the MSIE browser, a similar value is available in the document.body.scrollTop property.

See also:Document.body, Frame object, Window object, Window.moveBy(), Window.moveTo(), Window.pageXOffset, Window.scrollBy()

Property attributes: