Can't expand a collapsed strip

So I’m trying to create a button to expand a strip, set to be collapsed on load. This is my first time using Wix Code and I feel I might have some info missing, as I set up the code just as it says on the Wix tutorial and nothing works. When previewing the page the button is clickable but it does nothing and the strip stays collapsed. What am I doing wrong? This is the code I’m using. Thanks!

}
export function button20_click(event, $w) {
if ( $w(“#WannaHelpStrip”).collapsed ) {
$w(“#WannaHelpStrip”).expand();
}
else {
$w(“#WannaHelpStrip”).collapse();
}

1 Like

Hi Michal,

If you want to expand a strip when a button is clicked, you don’t have to use the if/else function. Here is a simple step-by-step example on how to expand strips using Wix Code .

Good luck!
Ben