Skip to content

Instantly share code, notes, and snippets.

@stevetrask
Created September 30, 2015 10:05
Show Gist options
  • Save stevetrask/a01099f5f36b70432721 to your computer and use it in GitHub Desktop.
Save stevetrask/a01099f5f36b70432721 to your computer and use it in GitHub Desktop.
$(function(){
$('#scrollNav li a').on('click', function(event) {
var target = $(this).attr("data-target");
console.log(target);
if( target.length ) {
event.preventDefault();
$('html, body').animate({
scrollTop: $('#'+target).offset().top - 55
}, 1000);
}
$(this).addClass('active');
$(this).parent().siblings().children('a').removeClass('active');
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment