TOC PREV NEXT INDEX

Put your logo here!


window.scroll()


Scrolls the window to a particular place in the document.

Syntax

window.scroll(x-coord, y-coord) 

Parameters

x-coord is the pixel along the horizontal axis of the document that you want displayed in the upper left.

y-coord is the pixel along the vertical axis of the document that you want displayed in the upper left.

Example

// put the 1000th vertical pixel at 
// the top of the window 
<INPUT TYPE="button" VALUE="1000" 
  onClick="scroll(0, 1000);"/> 

Notes

window.scrollTo() is effectively the same as this method.

For scrolling a particular distance repeatedly, use the window.scrollBy(). Also see window.scrollByLines(), window.scrollByPages().

Specification

DOM Level 0. Not part of specification. 


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX