Javascript: Auto-Scroll to Top of Page

Javascript allows you to scroll a page to a specific X, Y coordinate. This is simply done by using the "window" object's "scrollTo()" function. To scroll the page to the top use the following code:

window.scrollTo(0,0);

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.