Code for Show - Hide Function

Hello all… I am new to WIX and have come across a function I would like to do and struggling to get it to work just right.

I have added 12 buttons and 12 container boxes. Container boxes shall stay hidden until a specific button is clicked. The last button clicked will leave it’s container box until the next button is clicked etc.

So… I managed to figure out how to click button 1 and get container 1 to reveal just as I hoped, however nothing happens when I then click button 2.

Any help would be very much appreciated, cheers!

Hi Izweifel, Have you added a on click instruction for each button?
Can you post the code that you used for the button?

Hi,
I’d recommend you to check out this article about wix code’s basics.
You need to create an onClick event for each button, in the event’s code show the box you want and hide all other boxes(you can do that simply using the API, check it out here ).

Good luck :slight_smile:

Hi, thank you I did figure it out in the end. Now just trying to figure out how to stack each box on top of one another!

You can change the arrangement of stacked elements in the settings under “Arrange”.