Streaming live at 10am (PST)

Mobile nav does not close when menu-item links to ID on current page

Hi, in my nav i have menu-items that jump to an ID inside another page. like so:

/angebot#one
/angebot#two

However, when nav gets opened on page /angebot
it does not close when user selects menu-item /angebot#one

i.e. nav does not close when menu-item links to ID on current page

how can this be? i must be missing something…
any help on that would be appreciated.
thanks!


Here is a simple demo:
https://nav-jump-to-ids-on-current-page.webflow.io/angebot

Here is the read-only:
https://preview.webflow.com/preview/nav-jump-to-ids-on-current-page?utm_medium=preview_link&utm_source=designer&utm_content=nav-jump-to-ids-on-current-page&preview=b0b1223f80d617148a7aa19864382dfd&mode=preview

Copy-Paste This custom code before body (After jquery loaded) under page setting (For specific page) or under site setting (For entire site).

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

And publish the site. Reference for the code:

1 Like

Duuude - thank you so much!!!

it works perfectly!
case closed:-)