Skip to content

Instantly share code, notes, and snippets.

@chillbits-legacy
Last active September 15, 2016 10:06
Show Gist options
  • Save chillbits-legacy/605a78814abfd50c0a5a86b3fc204e74 to your computer and use it in GitHub Desktop.
Save chillbits-legacy/605a78814abfd50c0a5a86b3fc204e74 to your computer and use it in GitHub Desktop.
/** Viet Artisans fixes **/
// Dynamic menu activation
var vaj = jQuery.noConflict();
vaj(document).ready(function(){
currentURL = document.location.href;
vaj('.accordion-header a').each(function(index){
if(vaj(this).attr('href') == currentURL)
{
activeSideMenu(vaj(this));
return;
}
});
});
function activeSideMenu(item) {
item.css('font-weight','bold');
openParentMenu(item);
}
function openParentMenu(item) {
dropdownBody = item.closest('.accordion-body');
if(dropdownBody.length == 0) return;
dropdownBody.show().prev().addClass('open');
openParentMenu(dropdownBody.prev());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment