Navigation Dropdown - how to close on click anywhere?

Hi, I have a navigation where you can click on a menu item and through an interaction trigger it makes another div visible.

I want to click anywhere else on the page to make that element disappear again, how can I achieve that?

It seems like there is a lenghy discussion here but no definitive solution: Close dropdown menu - #4 by PeterDimitrov

Having your share link will make things easier.

Sounds like you can potentially have an overlay that fills the browser. This overlay will hold the “makes another div visible” content. Your navigation will open this overlay. Then, you can assign a “close” action to this overlay div, thereby closing every… not allowing the user to accidentally click on something else.

Again, this is just my wild vision of what you’re trying to do. Share link and deeper explanation will be helpful.

Hi, this is the link: Webflow - Onbau

Ignore the double navigation bar. When you click on the menu item “Leistungen”, a menu opens, now when you click on it again, it closes. I want it to close when I click anywhere on the page.

Hope that makes sense.

Still trying to solve this?

I decided to build my own custom navigation rather than using the native dropdown solution and am dealing with the same issue you’ve mentioned. Came across this amidst my research. When I come up with a solution I’ll report back. :sweat_smile: