Using this jQuery: https://github.com/JamyGolden/PlusAnchor
I am looking to make it scroll to the specific anchor but give it an top offset of 50px. I have a fixed header of 50px and when the page scrolls, the header covers part of the section.
Any help or a point in the right direction is appreciated.
Thanks
My code:
<script type="text/javascript">
$(document).ready(function(){
$('body').plusAnchor({
easing: 'easeInOutExpo',
speed: 800,
onInit: function( base ) {
if ( base.initHash != '' && $(base.initHash).length > 0 ) {
window.location.hash = 'hash_' + base.initHash.substring(1);
window.scrollTo(0, 0);
$(window).load( function() {
timer = setTimeout(function() {
$(base.scrollEl).animate({
scrollTop: $( base.initHash ).offset().top
}, base.options.speed, base.options.easing);
}, 500); // setTimeout
}); // window.load
}; // if window.location.hash
} // onInit
});
});
</script>
The answer to this question can be found here: https://github.com/JamyGolden/PlusAnchor/issues/1