jquery scroll top | How to scroll to top using jQuery

jQuery scroll to top

In this tutorial we will show you how to allow users scroll to top by clicking a link using jquery. This might be required for long content pages in your website. jQuery also provides scroll method, however to make scroll smooth we will use jquery animate method for our jquery scroll to top example.

jquery scroll top example

In following example jQuery animate() method is used to scroll to top as “Move Top” link is clicked. The animate method allows to specify speed of scroll as well. Example below uses test text just to ensure scroll bars are there. If you are testing it at local system, ensure to fill appropriate text so scroll bars are appeared.

Experience this example online


Was this article helpful?

Related Articles

Leave A Comment?