Skip to content

Instantly share code, notes, and snippets.

@mgirouard
Created September 27, 2013 17:33
Show Gist options
  • Save mgirouard/6732102 to your computer and use it in GitHub Desktop.
Save mgirouard/6732102 to your computer and use it in GitHub Desktop.
How to animate a scroll to an element on a page, without a plugin
// via http://stackoverflow.com/questions/6677035/jquery-scroll-to-element
$('html,body').animate({ scrollTop: $('#target').offset().top }, 500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment