Expand/Collapse Event handler

Okay, so I want to start with my site condensed like this:


And as users click on the buttons, text boxes show underneath them. I have the code for the text boxes to show as I click through them, but I ended up with a dead space between the buttons and the quote, if that makes sense. So I collapsed all the text boxes on load (they’re already hidden on load), and achieved the desired result - but when I click on the buttons now, the text boxes no longer show up. Is there an efficient way to do this? Or how would one code this?
Here’s the code I have so far for the “my journey to purpose” button to show. When it worked, I didn’t have any of the expand codes, but other than that the code was the same.

export function buttonpurpose_click(event, $w) {
//Add your code for this event here:
$w(‘#myjourneytopurpose’).show()
$w(‘#mylifebox’).hide()
$w(‘#mylifebox’).expand()
$w(‘#mebox’).hide()
$w(‘#mebox’).expand()
$w(‘#myteambox’).hide()
$w(‘#myteambox’).expand()
$w(‘#myjourneytopurpose’).expand()
}

Anyone have any advice? Thanks!

use collapse() not hide()

This is exactly what I’ve been trying to do. I’d like to know if you got it working and if you wouldnt mind sharing the finished code, please?

Okay, I tried that and it still didn’t work… any other suggestions?

I still can’t get it working either :expressionless: If I do I will let you know!

export function buttonpurpose_click(event, $w) {  
//Add your code for this event here:      
$w('#myjourneytopurpose').show()
$w('#mylifebox').collapse()     
$w('#mylifebox').expand()     
$w('#mebox').collapse()  
$w('#mebox').expand()     
$w('#myteambox').collapse()        
$w('#myteambox').expand() 
$w('#myjourneytopurpose').expand() 
} 

are you hiding $w(‘#myjourneytopurpose’) somewhere else in the code?

I was originally - i just had a simple show/hide when you clicked the buttons - hence the $w(’ #myjourneytopurpose ') show. Now I’ve deleted that hide, but kept the show to see if for some reason that was the issue.