How ro make the Mobile Navbar closes after a Clic, without changing Desktop Navbar Configuration

I’m trying to make the navigation on my site more comfortable for users, and when I switch from desktop to mobile view the Navbar menu doesn’t close after click on a nav_link
I’m been looking for an answer and I found this code, but it affects my desktop view when I click on the menu.
Any thoughts about this? Please let me know.

<script>
$('.w-nav-menu').on('click', 'a', function() {
  $('.w-nav-button').triggerHandler('tap');
});
</script> 

https://espressoamico.webflow.io/

Why don’t you use interactions and just hide navigation on click?

2 Likes

Hi Alex thanks for your answer. Have you made it that way?

I made a lot of things with interactions. I suggest you go to the Webflow university and learn everything about interactions - they are very powerful.

1 Like