Skip to content

Instantly share code, notes, and snippets.

@mikeoberdick
Created April 5, 2024 10:09
Show Gist options
  • Save mikeoberdick/f374181fb738ec6acaa3d51321aaf83f to your computer and use it in GitHub Desktop.
Save mikeoberdick/f374181fb738ec6acaa3d51321aaf83f to your computer and use it in GitHub Desktop.
Open up a bootstrap accordion/collapse using attribute from url following # symbol
if (window.location.href.indexOf("requirements") > -1 && window.location.href.indexOf("#") > -1) {
//get the text after the #
var tab = window.location.href.split('#')[1];
//if text is highResidency
if (tab == 'highResidency') {
$('#collapse-content-0').show();
} else {
$('#collapse-content-1').show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment