Home › Forums › Support › Offset anchors with fixed header › Reply To: Offset anchors with fixed header
September 21, 2016 at 11:34 am
#228373
Bin
<script>
jQuery(function($) {
$('li.smooth > 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 - 70
}, 500);
return false;
}
}
});
});
</script>
Does NOT work at all!!!