Latest web development tutorials

Window scrollTo () method

Window Object Reference Window object

Definition and Usage

scrollTo () method can scroll the contents to the specified coordinates.

grammar

scrollTo(xpos,ypos)

parameter description
xpos Required. To x coordinate of the upper left corner in the document window's document display area.
ypos Required. To y coordinates of the upper left corner in the document window's document display area.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support scrollTo () method


Examples

Examples

Scrolling content coordinate positions 100, 500:

function scrollWindow () {
window.scrollTo (100,500);
}

try it"


Window Object Reference Window object