Skip to content

Instantly share code, notes, and snippets.

@haribote
Last active August 29, 2015 14:05
Show Gist options
  • Save haribote/a8d74e90b85e1803b5ea to your computer and use it in GitHub Desktop.
Save haribote/a8d74e90b85e1803b5ea to your computer and use it in GitHub Desktop.
(function(window, $) {
// DOM Ready
$(function() {
$('.js-scroll').on('click', null, function(ev) {
ev.preventDefault();
var $target = $(this.hash);
if ($target.length > 0) {
$('html, body').animate({
scrollTop: $target.offset().top
}, 400);
}
});
});
})(this, jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment