Last active
August 29, 2015 14:15
-
-
Save nathanaelphilip/e9c26335de7bbe007587 to your computer and use it in GitHub Desktop.
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
jQuery(document).ready(function($) { | |
$('.navigate').on('click', function(event) { | |
event.preventDefault(); | |
var $target = $($(this).attr('href')); | |
scrollTo($target); | |
}); | |
// helpers | |
function scrollTo($element){ | |
$('html, body').animate({scrollTop: $element.offset().top}, 500); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment