Window.scrollBy() (Method)

Scroll the document in the window by a specific amount.

Availability:

JavaScript - 1.2
JScript - 3.0
Internet Explorer - 4.0
Netscape - 4.0
Property/method value type:undefined
JavaScript syntax:-myWindow.scrollBy(anOffsetX, anOffsetY)
-scrollBy(anOffsetX, anOffsetY)
Argument list:anOffsetXA distance in pixels
anOffsetYA distance in pixels

This method will scroll the window relative to its current position by the indicated amount. You can scroll in either the horizontal or vertical axis or even both at once.

Although the method is supported by MSIE and Netscape Navigator, they scroll in opposite directions vertically. It was probably too much to expect them to support the feature in the same way.

Warnings:

See also:Frame object, Window object, Window.moveBy(), Window.moveTo(), Window.pageXOffset, Window.pageYOffset, Window.scroll(), Window.scrollTo()

insert figure 0077