Menu icon Foundation

My Posts

No Content

My Comments

Paul Adams commented on Karl Ward's post about 2 years

Hi I am trying to alter the mtree plugin so that if the parent menu item has a child menu item selected the menu stays open while browsing through the sub menu pages, but closes when same level item is selected
I'm currently hacking the code using the following which I am very ashamed of!
 
Any advice on how to do this would be great as I have only just started JavaScript / jQuery
 
Many Thanks
$('.current-menu-parent').removeClass('mtree-closed').addClass('mtree-open mtree-active block');

$('.current-menu-parent').click(function(){
$(this).next('.sub-menu').slideUp();
$(this).toggleClass('block');
});
 
.block .sub-menu {
display:block!important;
overflow:visible!important;
height:auto!important;
}

Posts Followed


Following

    No Content

Followers

My Posts

No Content

My Comments

You commented on Karl Ward's post about 2 years

Hi I am trying to alter the mtree plugin so that if the parent menu item has a child menu item selected the menu stays open while browsing through the sub menu pages, but closes when same level item is selected
I'm currently hacking the code using the following which I am very ashamed of!
 
Any advice on how to do this would be great as I have only just started JavaScript / jQuery
 
Many Thanks
$('.current-menu-parent').removeClass('mtree-closed').addClass('mtree-open mtree-active block');

$('.current-menu-parent').click(function(){
$(this).next('.sub-menu').slideUp();
$(this).toggleClass('block');
});
 
.block .sub-menu {
display:block!important;
overflow:visible!important;
height:auto!important;
}

Posts Followed

Following

  • No Content

Followers

  • No Content