scrollTopscrollTop*
*Contents  *Index  *Topic Contents
*Previous Topic: scrollLeft
*Next Topic: scrollWidth

scrollTop

Description

Sets or retrieves the distance, in pixels, between the top of the element and the topmost portion of the content that is currently visible in the window. This is equal to the vertical distance that the content of the element has been scrolled.

Syntax

object.scrollTop[ = scrollTop]

Settings

This read-write property is always a nonnegative integer. Although it can be set to any positive or negative value, the property is set to zero if the assigned value is less than zero, and is set to the value of scrollHeight if the assigned value is greater than this. The default value is zero.

This property is always zero for elements that do not have scroll bars. For these elements, setting the property has no effect.

Remarks

For more information on how to access the dimension and location of elements on the page through the document object model, see Measuring Element Dimension and Location.

Applies To

BODY, BUTTON, DIV, FIELDSET, FRAME, IFRAME, IMG, MARQUEE, SPAN, TEXTAREA

See Also

scrollHeight, scrollLeft, scrollWidth


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.