Visit Mozilla.org

DOM:window.scrollTo

From MDC

« Gecko DOM Reference

Contents

[edit] Summary

Scrolls to a particular set of coordinates in the document.

[edit] Syntax

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

[edit] 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.

[edit] Example

window.scrollTo(0, 1000);

[edit] Notes

This function is effectively the same as window.scroll. For relative scrolling, see window.scrollBy, window.scrollByLines, and window.scrollByPages.

[edit] Specification

DOM Level 0. Not part of specification.