Skip to content
Snippets Groups Projects
Unverified Commit 5c8c53e7 authored by weaver299's avatar weaver299 Committed by GitHub
Browse files

Merge pull request #344 from ASCWebServices/canini-2

setting option to link to anchors within accordions and have accordio…
parents 0110c855 f0030199
No related merge requests found
......@@ -218,6 +218,20 @@ jQuery(document).ready(function(){
});
}
//check for anchor hash in url and if exists open accordion
var accordionAnchor = window.location.hash;
var accordAnchorTrimmed = accordionAnchor.substring(1);
if (accordionAnchor.length) {
var accordDiv = jQuery('[id="'+accordAnchorTrimmed+'"]').parent().parent().parent().parent().parent().attr('id'),
pattern = /collapse/,
exists = pattern.test(accordDiv);
if(exists) {
jQuery(window).scrollTop(jQuery('#'+accordDiv).offset().top);
jQuery('#'+accordDiv).addClass('in');
}
}
});
// window.addEventListener("load", function(event) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment