The navbar works as well as the smooth scroll, but I can not change the offset. My nav is 86px but no matter how many px I change it still goes to the same place.
$(document).ready(function () {
$('body').scrollspy({target: ".navbar", offset: 86});
$("#myNavbar a").on('click', function(event) {
if (this.hash !== "") {
event.preventDefault();
var hash = this.hash;
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
window.location.hash = hash;
});
}
});
});
I added the info directly to the body tag and still no change. I know that jquery is working as it does scroll smooth and the collapse nav works as well.
<body data-spy="scroll" data-target=".navbar" data-offset="86">