window Methods: scrollTo()

By: Dusty Arlia
Published on Tuesday, September 16, 2014 at 9:04 PM
Last Updated on Tuesday, July 14, 2015 at 10:59 PM
Total Updates: 3

The scrollTo() (and its synonym scroll()) method of the JavaScript window object passes two arguments: x and y document coordinates. These coordinates get set as the scrollbar offsets (or as close as it can to it). HTML Element objects do not have a scrollTo() method like the window object.