Skip to content

Instantly share code, notes, and snippets.

@anthonybruno
Created November 1, 2011 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonybruno/1331285 to your computer and use it in GitHub Desktop.
Save anthonybruno/1331285 to your computer and use it in GitHub Desktop.
jQuery animated anchor navigation
$('nav a').click(function(){
var item = $(this).attr('href');
var item_y = $(item).offset().top;
$('html, body').animate({"scrollTop": item_y - 120}, 400);
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment