Side menu closing after selecting submenu
-
Hello everyone!
I’ve got a problem I believed had a solution on other thread, but just to some point and not entirely.
The things is that my menu closes after I select a submenu of level 3.
My menu structure:
Parent menu
Submenu 1
Submenu 2
Submenu 3After adding JS code given by @wptuki in his thread, When I select submenu 1 or 2, the menu stays open after loading selected page. The parent menu closes when I click one of the submenu 3 pages. To expand it fully again, I need just to click on the parent menu arrow again – then all submenus, including 3, show as expanded already. I’m sure this problem is connected with the parent menu code.
I guess I’m not familiar enough with JS, could someone help me to solve this problem?I believe this code, found in another topic (by @wptuki), just needs to be modified, but I have really no clue how to do it properly.
Code:
(function($) {
$( document ).ready(function() {
$( “li.current_page_item” ).each(function( index ) {
$(this).parent(‘.sub-menu’).slideToggle(‘fast’);
$(this).parent().parent(‘.sub-menu’).slideToggle(‘fast’);
});$( “li.current-menu-parent” ).each(function( index ) {
$(this).parent(‘.sub-menu’).slideToggle(‘fast’);
});
});
})(jQuery);Regards and kisses! ??
- The topic ‘Side menu closing after selecting submenu’ is closed to new replies.