DHTML Methods
Causes the object to scroll into view, aligning it at either the top or bottom of the window.
object.scrollIntoView ( [ bAlignToTop ] )
bAlignToTop |
Optional. Boolean value specifying whether to place the object at the top of the window or at the bottom. If true, the method causes the object to scroll so that its top is visible at the top of the window. If false, the bottom of the object is visible at the bottom of the window. If no value is specified, the object scrolls to the top by default. |
No return value.
The following example causes the element to scroll into view within the window, placing it at either the top or bottom of the window. The method is useful for immediately showing the user the result of some action without requiring the user to manually scroll through the document to find the result. This example underlines the content of the document's fifth paragraph and scrolls it into view at the top of the window.
var coll = document.all.tags ( "P" );
if ( coll.length >= 5 ) {
coll ( 4 ).style.textDecoration = "underline";
coll ( 4 ).scrollIntoView ( true );
}