Go to top of page using jQuery


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



Copy this code and paste it in your HTML
  1. $( 'html, body' ).animate( { scrollTop: 0 }, 0 );
  2.  
  3. // or
  4.  
  5. $( 'html, body' ).animate( { scrollTop: 0 }, 'slow' );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.