Il codice è semplice e lineare:
$(document).on('click', 'a[href^="#"]', function (event) {event.preventDefault();$('html, body').animate({scrollTop: ( $($.attr(this, 'href')).offset().top - 100 )}, 500);});
E dove a[href^="#"]
sono i link con ancore.