Skip to content

Instantly share code, notes, and snippets.

@KaiserEMP
Created October 28, 2018 12:32
Show Gist options
  • Select an option

  • Save KaiserEMP/a8e13d5ec651f79bbf14355c186edd9d to your computer and use it in GitHub Desktop.

Select an option

Save KaiserEMP/a8e13d5ec651f79bbf14355c186edd9d to your computer and use it in GitHub Desktop.
js
/* Toggle submenus */
$('.megamenu-container .expander').click(function(){
$(this).parent().toggleClass('current-menu-item');
});
/* Toggle desktop submenus */
$('.megamenu-container .sub-menu-container .expander').click(function(){
$(this).parent().toggleClass('current-menu-drop');
});
/* Current menu traverse */
$('.mega_columns .menu-item').each(function(){
if ($(this).hasClass('current-menu-item')) {
//$('body').css("background-color", "yellow");
$(this).closest('.has_subitems').children('.menu-link').addClass('current-menu-item');
$(this).closest('.has_subitems').addClass('current-menu-drop');
//$(this).addClass('testing');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment