Please visit this link.
Try to click "Portfolio" link, it should be highlighted with blue background.
But after clicking outside the navigation bar it will be highlighted with blue.
//scrolling
$('nav a').on('click', function() {
var scrollAnchor = $(this).attr('data-scroll'),
scrollPoint = $('section[data-anchor="' + scrollAnchor + '"]').offset().top;
$('body,html').animate({
scrollTop: scrollPoint
}, 500);
return false;
});
//change color
$(window).scroll(function() {
var windscroll = $(window).scrollTop();
if (windscroll) {
$('section').each(function(i) {
if ($(this).position().top <= windscroll) {
$('nav a.active').removeClass('active');
$('nav a').eq(i).addClass('active');
}
});
}
}).scroll();