Back to top button


/ Published in: PHP
Save to your folder(s)

Button that onclick with scroll to top of the page


Copy this code and paste it in your HTML
  1. // Back To Top
  2. $('a.top').click(function(){
  3. $(document.body).animate({scrollTop : 0},800);
  4. return false;
  5. });
  6.  
  7. //Create an anchor tag
  8. <a class="top" href="#">Back to top</a>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.