It would take a bit of computation, like what I have done for this site http://wer1.net
$(document).scroll(function(e) {
var curpos = $(this).scrollTop();
var winheight = $(window).height();
$('.js-anchor-nav a').reverse().each(function() {
var $elem = $(''+$(this).attr('href'));
var elempos = $elem.offset().top;
if(curpos <= elempos) {
$(this).parent().addClass('active')
.siblings().removeClass('active');
}
});
});
$('.js-anchor-nav li').click(function() {
var $elem = $(''+$(this).children('a').attr('href'));
$('html, body').animate({
scrollTop: $elem.offset().top
- $('#header').height()
- ($(document).scrollTop() == 0 ? 93 : 0) // magic. do not touch
}, 800);
});