Skip to content

Instantly share code, notes, and snippets.

@evandroeisinger
Created May 20, 2013 18:06
Show Gist options
  • Save evandroeisinger/5614041 to your computer and use it in GitHub Desktop.
Save evandroeisinger/5614041 to your computer and use it in GitHub Desktop.
Simple content smoth navigation.
/* Smoth content navigation */
$('.menu .link', '.context').on('click',function (e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 900, 'swing', function () {
window.location.hash = target;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment