I'm using JQuery to smooth scroll images:
function smoothScrollTo(hash) {
$("html:not(:animated).,body:not(:animated)").animate({
scrollTop: $(hash).offset().top
}, 650, function () {
location.hash = hash;
});
}
$(function () {
$("#content-images li a[href*=#]").click(function () {
this.blur();
smoothScrollTo(this.hash);
return false;
});
});
It's working fine however I have a fixed nav bar on the site which stays on the top of the page as it scrolls. When the page scrolls down to the next image, it scrolls underneath the nav bar obscuring apart of it from vision.
My question is, how can I modify the above code to compensate for the height of my fixed nav bar?
Any help would be much appreciated,
T