Auto close menu on click for anchor scroll

Hi,

i set one of the menu link as anchor that scroll on homepage to the section i want, other links go to pages.

On mobile view, the menu will not close after user click on this link, so what appen is: see the scroll to the section but user still see also the menu until he dont click on menu icon to close it.

Is possible to get a function to solve it?

thanks in advance

Hi there

Thank you for contacting us, I’m sorry to say but there is no such option, we have exact same behavior on our demo and yet there is no option to auto-close mobile menu

Hi noweiss,

I had the same problem. I added a small piece of jquery code which solved the problem:

jQuery('.responsive-menu .menu-item a').on('mousedown', function () {
        jQuery(this).closest('.responsive-menu').toggle('active');
      });

I make use of have a child theme for my custom css. In the child theme I added a javascript file with this code. If you don’t use a child theme, you could also make use of plugin “Header and Footer Scripts” and add the code over there.

Good luck!

Hi there

@vinniedl Thank you so much, your contribution is very much appreciated