how to link to anchor in closed accordion
I am using the script below to link to anchors that are in closed content (accordions) on other pages. it works fine. However, I can't figure out how to edit the code to get it to open an accordion on the same page as the hyperlink. Refreshing the page works, but it's a cumbersome user experience.
<script>
var openAcc = '#' + window.location.hash.substring(1)
if(openAcc != '#'){
$('#accordion .in').removeClass('in');
$(openAcc).closest('.collapse').addClass('in');
$('html,body').animate({scrollTop: $(openAcc).offset().top - 65},1000);
}
</script>