Created
July 26, 2014 13:44
-
-
Save technbuzz/3beafa238fb1786053ff to your computer and use it in GitHub Desktop.
A nice and smooth scroll transition to particular section, normally used in single page navigaiton.
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
$("nav").on('click','a',function (event) { | |
event.preventDefault(); | |
var elAttr = $(this).attr('href'); | |
$('body,html').animate({ | |
scrollTop: $(elAttr).offset().top | |
},700); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment