• @phpbits

    Hi there, I know my issue might be similar to the ones that other people have posted earlier but wanted to elaborate my request.

    I have installed this plugin on my left-side menu.

    Now, I have three levels of menu

    Parent
    Menu 1
    Sub-menu 1
    Sub-menu 2

    Initially, only the ‘Parent’ will be seen and when i click on it, it expands to display the Menu 1. Clicking Menu 1 displays its children.

    Now, when I click Sub-menu 1, it refreshes to display the page but the entire section collapses to reveal only the ‘Parent’ again.

    I would like it to stay expanded and not collapse entirely. It is not the right user experience. If he is on Sub-menu 1, he might want to go into Sub-menu 2 and so on. Why the need to collapse the entire section? Let him have the freedom to close it.

    Please let me know how to change the code for this or introduce an updated version with the auto-close disabled. (Note: I am new to coding and learning the tricks. I tried to figure out what code does this but couldn’t get it.)

    Appreciate your quick assistance. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • +1

    Hi guys, adding this in my header.php just below the wp_head() function works for me where I have a menu as follows:

    Parent
    -Child
    –Grandchild

    <script>
    	(function($) {
            $( document ).ready(function() {
                   $( "li.current_page_item" ).each(function( index ) {
                      $(this).parent('.sub-menu').slideToggle('fast');
                    });
    
                    $( "li.current-menu-parent" ).each(function( index ) {
                      $(this).parent('.sub-menu').slideToggle('fast');
                    });
    
    				$( "li.current-menu-item" ).each(function( index ) {
                      $(this).parent('.sub-menu').slideToggle('fast');
                    });
            });
    	})(jQuery);
    </script>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disabling Auto-close function’ is closed to new replies.