Created
April 27, 2019 17:06
-
-
Save amouratoglou/9baf0712c5e2b3c26468c9b70ad4c821 to your computer and use it in GitHub Desktop.
smooth scroll on click to anchor link jquery #js #jquery #smoothscroll
This file contains 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; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment