Wix Pro Gallery fail collapse

Hi,

Someone can help me? I would like to use Wix Pro Gallery with expand and collapse.
I would like to use more than one galleries. All galleries expand when the functional buttons was clicked. Despite of some galleries are specified collapse.
I attached a picture about my problem.

What is the problem?

Code:
export function button1_click(event, $w) {
//Add your code for this event here:
$w(“#gallery1”).expand();
$w(“#gallery2”).collapse();
$w(“#gallery3”).collapse();
}

export function button2_click(event, $w) {
//Add your code for this event here:
$w(“#gallery1”).collapse();
$w(“#gallery2”).expand();
$w(“#gallery3”).collapse();
}

export function button3_click(event, $w) {
//Add your code for this event here:
$w(“#gallery1”).collapse();
$w(“#gallery2”).collapse();
$w(“#gallery3”).expand();
}

export function button4_click(event, $w) {
//Add your code for this event here:
$w(“#gallery1”).expand();
$w(“#gallery2”).expand();
$w(“#gallery3”).expand();
}

Thanks for help!
Daniel

I have a collapsing gallery on a page and it works on Edge but not Chrome or Safari. I don’t know the answer to the problem though. When I search the issue on the forum it points to this post and says there are 30 comments but I don’t see any so that is also confusing. If you did resolve the collapsing issue with galleries please let me know. I have several text and html elements on the same page as my gallery and they are all collapsing fine, but the gallery won’t work.