WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

ScrollBoxObject

This object is available to unprivileged JavaScript. It implements the following interfaces:

Methods

void ensureElementIsVisible ( Element child ) void ensureIndexIsVisible ( PRInt32 index ) void ensureLineIsVisible ( PRInt32 line ) void getPosition ( out PRInt32 x , out PRInt32 y ) void getScrolledSize ( out PRInt32 width , out PRInt32 height ) void scrollBy ( PRInt32 dx , PRInt32 dy ) void scrollByIndex ( PRInt32 dindexes ) void scrollByLine ( PRInt32 dlines ) void scrollTo ( PRInt32 x , PRInt32 y ) void scrollToElement ( Element child ) void scrollToIndex ( PRInt32 index ) void scrollToLine ( PRInt32 line )

void ensureElementIsVisible ( Element child )

Arguments:
child

void ensureIndexIsVisible ( PRInt32 index )

Arguments:
index

void ensureLineIsVisible ( PRInt32 line )

Arguments:
line

void getPosition ( out PRInt32 x , out PRInt32 y )

Get the current scroll position in css pixels.

Arguments:
x
y

void getScrolledSize ( out PRInt32 width , out PRInt32 height )

Arguments:
width
height

void scrollBy ( PRInt32 dx , PRInt32 dy )

Scroll the given amount of device pixels to the right and down. Values will be clamped to make the resuling position legal.

Arguments:
dx
dy

void scrollByIndex ( PRInt32 dindexes )

Arguments:
dindexes

void scrollByLine ( PRInt32 dlines )

Arguments:
dlines

void scrollTo ( PRInt32 x , PRInt32 y )

Scroll to the given coordinates, in css pixels. (0,0) will put the top left corner of the scrolled element's padding-box at the top left corner of the scrollport (which is its inner-border-box). Values will be clamped to legal values.

Arguments:
x
y

void scrollToElement ( Element child )

Arguments:
child

void scrollToIndex ( PRInt32 index )

Arguments:
index

void scrollToLine ( PRInt32 line )

Arguments:
line

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com