Prevent Body Scroll Not Working Now

Ah sorry, I see what you meant. I haven’t done it that way with a Webflow project as it’s always been two buttons.

In the event listener you could use an if statement to figure out what state the modal is in, if it’s visible, then close it, otherwise open it.

https://stackoverflow.com/questions/9456289/how-to-make-a-div-visible-and-invisible-with-javascript

2 Likes