I have a jQuery function that does a smooth scrolling on the page by clicking the ID link.
$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
It works perfectly. The problem is that I have a div with position fixed of height: 100px
that gives an overlay in the first 100px of the div. I need to add these 100px at the time the Scroll happens, by clicking on the div. I have no idea how to do this.