-
-
Save marzique/6728693f7d0784049e1ece87c703d9df to your computer and use it in GitHub Desktop.
jQuery: JQuery smooth scrolling when clicking an anchor link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a').click(function(){ | |
$('html, body').animate({ | |
scrollTop: $( $.attr(this, 'href') ).offset().top | |
}, 500); | |
return false; | |
}); | |
// http://stackoverflow.com/questions/7717527/jquery-smooth-scrolling-when-clicking-an-anchor-link/7717572#7717572?newreg=16ca424bc4024b21a4fcc728ea6451d5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment