Mobile menu doesn’t work properly

Nikolina May 5, 2021 at 8:14 pm

Hello, I can’t seem to get my One-Page navigation working on the mobile menu. I can see that the site is scrolling down to the sections, but the user has to click the X to make the menu disappear instead of the menu disappearing automatically once link is clicked. Is there any solution to this? I already tried deactivating plugins and it seems that is not an issue. Thank you for your help.

Replies (3)

  1. Nikolina May 5, 2021 at 8:14 pm

    Hello, I can’t seem to get my One-Page navigation working on the mobile menu. I can see that the site is scrolling down to the sections, but the user has to click the X to make the menu disappear instead of the menu disappearing automatically once link is clicked. Is there any solution to this? I already tried deactivating plugins and it seems that is not an issue. Thank you for your help.

  2. Spiracle Themes May 6, 2021 at 6:54 am

    Hi Nikolina

    Try the following method

    1) First of all install & activate plugin Code Snippets
    You can directly install the plugin from Plugins -> Add New and search for Code Snippets in the search bar

    2) After this, Go to Snippets -> All Snippets and click on Edit link of the Example JavaScript Snippet. Check Screenshot

    VIEW SCREENSHOT

    3) After this, Add title and code and set the script to run on the front end only, and then save and activate it.

    VIEW SCREENSHOT

    CODE:

    (function ($) {
    		  $(document).ready(function () { 
    
    			$( '.hd-bar .side-menu ul li a' ).on("click", function(){
    			  $(".hd-bar").removeClass("visible-sidebar");
    			});
    
    		  });        
    
    	})(this.jQuery);

    4) Refresh your page and check

    Best Regards

  3. Nikolina May 6, 2021 at 7:27 pm

    Thank you for your time, it is working perfectly now! Thank you!

  4. Spiracle Themes May 7, 2021 at 6:01 am

    You are welcome 🙂

Post a Reply

Reply To: Mobile menu doesn’t work properly
Your information: