esatto... non mi tenere sulle spine...
Dove 'nav a' rappresenta il link alla section, mentre '#header' rappresenta l'ID dell'header fixedcodice:$(document).ready(function() { var $root = $('html, body'); $('nav a').click(function() { var div = ($(this).attr('href').substring(1)); var spacing = $('#header').outerHeight(); $root.animate({ scrollTop: $('#' + div).offset().top - spacing }, 750); }); });
Ovviamente per fare ciò devi avere già jQuery incluso nel tuo progetto