Skip to Content
JavaScript: The Definitive Guide, 5th Edition
book

JavaScript: The Definitive Guide, 5th Edition

by David Flanagan
August 2006
Intermediate to advanced
1018 pages
34h 13m
English
O'Reilly Media, Inc.
Content preview from JavaScript: The Definitive Guide, 5th Edition

Name

HTMLElement.scrollIntoView( ): make an element visible — Firefox 1.0, IE 4, Safari 2.02, Opera 8.5

Synopsis

element.scrollIntoView(top)

Arguments

top

An optional boolean argument that specifies whether the element should be scrolled to the top (true) or bottom (false) of the screen. This argument is not supported by all browsers, and elements near the top or bottom of a document cannot usually be scrolled to the opposite edge of the window, so this argument should be considered only a hint.

Description

If an HTML element is not currently visible in the window, this method scrolls the document so that it becomes visible. The top argument is an optional hint about whether the element should be scrolled to the top or bottom of the window. For elements that accept the keyboard focus, such as the Link and Input elements, the focus( ) method implicitly performs this same scroll-into-view operation.

See Also

Anchor.focus( ), Input.focus( ), Link.focus( ), Window.scrollTo( )

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaScript: The Definitive Guide, 7th Edition

JavaScript: The Definitive Guide, 7th Edition

David Flanagan
JavaScript from Beginner to Professional

JavaScript from Beginner to Professional

Rob Percival, Laurence Svekis, Maaike van Putten, Codestars By Rob Percival

Publisher Resources

ISBN: 0596101996Supplemental ContentErrata Page