Nav Interaction doesn't work twice

I’ve created a navigation hamburger menu for use on my portfolio site, and the interaction used to open and close it behaves correctly when done once (on a single page).

When the navigation is opened, closed, and opened a second time (on a single page), the X used to close the menu no longer animates in as it did the first time, and the navigation menu is stuck open. The rest of the interaction animates in properly, and I just can’t close it. This occurs in Preview Mode and on the published Webflow io link.

Can anyone help me figure out why this is the case? The interaction works the first time, so I don’t know why it would differ on its second use. Thank you!


Here is a read-only link to [My portfolio site]

On menu moves out you’re passing menu black to hide (display:none).
But on menu moves in you’re never changing the hide property of menu black. So it stays hidden.

Basically you’re changing the opacity of an element that’s invisible because it’s display:none.

(also you don’t need to set all the initial state on the menu moves out IX again, I think)

1 Like

Vincent,

Thank you for your response, now it seems so obvious. I removed the Hide/Show on the menu out interaction and it’s fixed!

I appreciate you taking the time to help out and get back to me. This is my first full-site build on Webflow and I’m close to finishing. Thank you for helping me out during this process.

Honestly, I knew what was happening: you had some state of something defined by your IX and not redefined by the second IX. But when I oepend the IX, I was like “pff too many things to check, let’s forget it” :rofl:

But what I did before giving up is just finding the name of the element containing the X, making it not show up on preview, inspecting it in the browser. I saw that is was display:none, and I just checked if you where setting its display in the first IX: it was not.

So it was simpler than it seemed. But often, I know what’s happening, but that’s too much work to check on complex interactions, so I often give up, answering just “you’ve set something you’re not reseting later” and let the user figure out what it is.

Because in 90% of the cases, it’s the same mistake. It will happen to you again as it is happening to me frequently still :slight_smile:

1 Like

That’s a good way to approach diagnosing issues like this, and I’ll keep that in mind for the future. Thanks again for your time, Vincent, have a good one! :slight_smile:

1 Like

Great if you understand the principle, and the logic to debug, that’s the most important part!

1 Like