Exportar (0) Imprimir
Expandir todo
EN
Este contenido no se encuentra disponible en su idioma, pero aquí tiene la versión en inglés.

scrollIntoView method

Causes the object to scroll into view, aligning it either at the top or bottom of the window.

Syntax

object.scrollIntoView(varargStart)

Parameters

varargStart [in, optional]

Type: Variant

Variant of type Boolean that specifies one of the following values:

TRUE (true)

Default. Scrolls the object so that top of the object is visible at the top of the window.

FALSE (false)

Scrolls the object so that the bottom of the object is visible at the bottom of the window.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Standards information

There are no standards that apply here.

Remarks

The scrollIntoView 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.

Depending on the size of the given object and the current window, this method might not be able to put the item at the very top or very bottom, but will position the object as close to the requested position as possible.

Examples

This example uses the scrollIntoView method to underline the content of the document's fifth paragraph and scroll 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);
   }

See also

a
address
applet
area
b
big
blockQuote
br
button
caption
center
cite
code
col
colGroup
comment
controlRange
custom
dd
dfn
dir
div
dl
dt
em
embed
fieldSet
font
form
hn
hr
i
iframe
img
input type=button
input type=checkbox
input type=email
input type=file
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
kbd
label
legend
li
listing
map
marquee
menu
noBR
object
ol
p
plainText
pre
s
samp
select
small
span
strike
strong
sub
sup
table
tBody
td
textArea
TextRange
tFoot
th
tHead
tr
tt
u
ul
var
wbr
xmp

 

 

Mostrar:
© 2014 Microsoft