Skip to main content
All CollectionsTroubleshooting and FAQsFrequently Asked QuestionsTheme Customizer
How to Automatically Close the Divi Slide-In Menu When a Menu Item is Clicked on a One Page Site
How to Automatically Close the Divi Slide-In Menu When a Menu Item is Clicked on a One Page Site

Learn how to make Divi's slide-in menu automatically close after clicking a menu item on a one-page site for seamless navigation.

Updated over 4 months ago

For one-page websites, ensuring smooth navigation is key to providing a seamless user experience.

If you're using Divi's slide-in menu, you might notice that it doesn't automatically close when a menu item is clicked. This can be inconvenient for users, especially on mobile devices.

This article will guide you through the steps to configure the Divi slide-in menu to automatically close when a menu item is clicked, enhancing the usability and flow of your one-page site.

  1. Go to WordPress Dashboard β†’ Divi β†’ Theme Options β†’ Integrations Tab

  2. Add the following jQuery script:

    <script>
    (function ($){
    $(document).ready(function () {
    var menuItem = $('.menu-item a');
    menuItem.each(function () {
    $(this).bind('click', function () {
    $('#et-top-navigation .mobile_menu_bar').trigger('click');
    })
    })
    });
    })(jQuery)
    </script>

  3. Save your changes.

Each time a menu item is clicked the Divi Slide-In Menu will automatically close.

Did this answer your question?