Title: Disabling Auto-close function
Last modified: June 6, 2017

---

# Disabling Auto-close function

 *  [omegacube](https://wordpress.org/support/users/omegacube/)
 * (@omegacube)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/disabling-auto-close-function/)
 * [@phpbits](https://wordpress.org/support/users/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)

 *  [fallendea](https://wordpress.org/support/users/fallendea/)
 * (@fallendea)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/disabling-auto-close-function/#post-9491936)
 * +1
 *  [rabidsquid](https://wordpress.org/support/users/rabidsquid/)
 * (@rabidsquid)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/disabling-auto-close-function/#post-9492165)
 * 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.

 * ![](https://ps.w.org/easy-sidebar-menu-widget/assets/icon-256x256.png?rev=1512397)
 * [Easy Sidebar Menu Widget](https://wordpress.org/plugins/easy-sidebar-menu-widget/)
 * [Support Threads](https://wordpress.org/support/plugin/easy-sidebar-menu-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-sidebar-menu-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-sidebar-menu-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-sidebar-menu-widget/reviews/)

## Tags

 * [expand collapse](https://wordpress.org/support/topic-tag/expand-collapse/)

 * 2 replies
 * 3 participants
 * Last reply from: [rabidsquid](https://wordpress.org/support/users/rabidsquid/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/disabling-auto-close-function/#post-9492165)
 * Status: not resolved