Scroll to Top of Page with jQuery


 / Published in: jQuery
 

This is a simple way to scroll to the top of the page, when an anchor tag has been clicked. Note that we must "return false," in order to disable the default browser action.

  1. $('#someAnchor').click(function() {
  2. $('html, body').animate({ scrollTop:0 }, 'fast');
  3. return false;
  4. });

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: frysteen on October 1, 2010

Excellent... thanks!

Posted By: frysteen on October 1, 2010

Excellent... thanks!

Posted By: EssayRtrty on August 17, 2019

This book is so good! I even had to write an essay about it in university for our Literature class. Unfortunately I had a lot of other assignments lined up and knew that I won't be able to finish my essay on time. That is why I decided to go to my favorite website Rankmywriter service, where professional writers can write essays for money. Prices there a very low and the quality is always good!

Posted By: puremelda2019 on October 10, 2019

Considering the vast number of companies offering Nursing Writing Services in the market today, we stand out as the best writing company offering Cheap Dissertation Writing Services.

You need to login to post a comment.