Created
September 30, 2015 10:05
-
-
Save stevetrask/a01099f5f36b70432721 to your computer and use it in GitHub Desktop.
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(){ | |
$('#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