Created
January 27, 2015 08:57
-
-
Save kickboxer/56337dfe616af5d8fcc0 to your computer and use it in GitHub Desktop.
jQuery scrollTo
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
$(function(){ | |
$('a[href^="#"]').click(function(){ | |
var target = $(this).attr('href'); | |
$('html, body').animate({scrollTop: $(target).offset().top}, 1000); | |
return false; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment