Trigger gallery popup from code

Hello, I want to accomplish something fairly simple but I can’t seem to find the right functions in Corvid.

Image an image gallery with id #myGallery.
Typically, if you click on a gallery, it opens the gallery in a popup, where you can swipe left/right through the images.

I want a button that also opens the gallery popup when clicking. I tried adding a javascript function ‘openGalleryPopup()’ for the onClick of the button that like shown below. However, there doesn’t seem to be a method on the Gallery object to trigger the popup. Is this possible at all?

export function openGalleryPopup(event) {
console.log(‘trying to open gallery popup’);
$w(‘#myGallery’).???;
}

Thanks for your help

Have a look at the Gallery API and the clickAction function.
https://www.wix.com/corvid/reference/$w.Gallery.html

Thank you for replying.
However, I think this does not resolve my question.

The clickAction function either gets or sets the clickAction through a string (e.g. “expand”), but it does not TRIGGER a click, nor does the expand() method in the Gallery API.

Do you have any other suggestions?

@boontom Did you ever find a solution to this? I’m looking for the same thing, but for just a single image, not a gallery. It seems bizarre that you can get and set the click action from code, but you can’t actually invoke it.