// you can change the offset by changing "-120" to a different number
// smooth scroll
$(document).ready(function(){
$('a[href^="#"]').on('click',function (e) {
e.preventDefault();
var target = this.hash;
var $target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top-120
}, 900, 'swing', function () {
window.location.hash = target;
});
});
});
// important a-tags should start with a #
// and divs or sections should have a id with the name
<nav>
<a href="#home">Home</a>
<a href="#work">Work</a>
<a href="#video">Video</a>
<a href="#testimonials">testimonials</a>
</nav>