I have a link like this:
<a href="mywebsite/testing/#collapse416">Testing</a></li>
Which opens an accordion on a page. It targets the div of the collapse of the bootstrap accordion. However when it opens, it's not opening at the top of the div. I realized it's because my banner on top is fixed and when it opens the target link, its not accounting for the offset I added to the body.
So how would I add an offset padding top to the target link. So that it offsets the fixed banner. This is the code im using so far to target and open the accordion:
<script type="text/javascript">
(function( $ ) {
$(document).ready(function() {
var anchor = window.location.hash.replace("#", "");
$(".collapse").collapse('hide');
$("#" + anchor).collapse('show');
});
})( jQuery );
</script>