Skip to content

Instantly share code, notes, and snippets.

@koomai
Created March 18, 2012 14:11
Show Gist options
  • Save koomai/2073553 to your computer and use it in GitHub Desktop.
Save koomai/2073553 to your computer and use it in GitHub Desktop.
Javascript: jQuery scrollTop animate
//animates to top of page
$('html, body').animate({
scrollTop: $(".selector").offset().top
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment