Forum Academy Marketplace Showcase Pricing Features

(Solved) How to close/open element with same click

I want to have a user able to click on an element to view more info and then click it a second time to hide the info. I’m guessing this has something to do with custom states, but I wanted to post the question on the forum.

Although this could be done via a custom state I would just do a conditional… When the button is pressed, and X is not visible, show X. When the button is pressed and X is visible, hide X.

You could trigger a custom state. and then set the element to be visible based on the state. But this would require a conditional anyway.

1 Like

I found this YouTube tutorial the other day. It uses a button to show and hide text.

I think you can use the exact same method to achieve what you’re describing, take a look:

4 Likes

Lol, I don’t know how I missed this very obvious solution. Thanks!