jQuery animated page scroll to anchor tag function


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

This function allows you to pass any div anchor tag as a parameter to scroll to. You can easily add easing after the 'duration' parameter in the jQuery animation function.


Copy this code and paste it in your HTML
  1. function scroll_to(div){
  2. $('html, body').animate({
  3. scrollTop: $(div).offset().top
  4. },1000);
  5. }

URL: http://www.ksnagra.com/examples/jquery/page-scroll-to-anchor-tag/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.