Mobile menu does not hiding

Hi see here: https://www.logoglo.com/

I have this css to make the mobile menu fixed top:

@media (max-width:979px) {
    .x-navbar-fixed-top {
        position: fixed!important
    }
}

And I had this js code to make the menu disappear once clicked, so it scrolls down to (eg) why us, and closes.

!function(n){n(".x-one-page-navigation-active .x-navbar .mobile .x-nav > .menu-item:not(.menu-item-has-children)").on("click touchend",function(){n(".x-btn-navbar").trigger("click")})}(jQuery);
jQuery('document').ready(function($) {;
});

Is there a way to make the menu hide once click on? in mobile view.

Thanks.

Hi @logoglo,

Thank you for reaching out to us. As you see this requires custom development as this is not a theme feature by default and is outside of our support scope, but we will do our best to help you getting started with the customization but we will not be able to implement it. You can try replacing your code with the following:

jQuery(document).ready(function($){
	$('.x-one-page-navigation-active .x-navbar .mobile .x-nav > .menu-item:not(.menu-item-has-children)').on('click touchend', function(e) {
		document.getElementsByClassName("x-btn-navbar")[0].click()
	});
});

Please note that the code provided above serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer.

Hope this helps!

This worked perfectly, thank you so much!

You’re very welcome, @logoglo!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.