Expanding a pro gallery doesn't work

Hello, I’m trying to make something very simple.

I put a pro gallery in a popup.

I would like that when the popup is loaded, the gallery enters in full screen expanded mode on the first item.

here’s my code :

//popup page

$w . onReady ( function () {
$w ( “#mygallery” ). expand ();
});

what happens :

nothing

Why?
i’m confused :roll_eyes:

Your GALLARIES-ID is - - → “myGallery” are you sure?
Or maybe your galleries ID is for example - - > “gallery1” ???

I put a pro gallery in a popup.

I would like that when the popup is loaded

And what the hell is a - - > " pop-up " ? a new wix-element i don’t know about?

pop-up = box / container?
pop-up = columnstrip ?
pop-up = some other of the provided wix-elements?

Hello velo-ninja, thank you very much for your answer.
1/ I wrote “#mygallery” to make it generic like it is in the doc but in my project it’s #gallery1
I did not type the wrong #id in my code but #gallery1

2/ I use Wix in french, i don’t know the wix english translation for “Fenêtre Pop-up”… maybe… pop-up window? So here’s a capture :


Thank you for your help :slight_smile:

Ok, a premier → utilize pas → FRANCAIS ← , essayez d’utiliser l’anglais.
Pet-etre, c’est le temps pour apprendre anglais :grin:

A PROGRAMMER always codes and works in ENGLISH .

Ton → "Fenetre-Pop-Up est = LIGHTBOX. Maintenant je comprendre qu’est-ce-que tu veux savoir.

LIGHTBOX-CODE:

$w.onReady(function () {
	$w("#gallery1").expand();
	$w("#gallery1").show("fade");
});

When your LIGHTBOX opens, the LIGHBOX-CODE should start automaticaly.

Of course you need a code to open LIGHBOX (fenetre pop-up).
Also pay attention onto the correct used ID of your elements.

hello velo-ninja,

thank you very very much for your answer
it’s very kind to try to help me

As you can notice i wrote this whole conversation in english since the begining.
The project i’m working on is set in french and i though that popup was also translated “popup” in the english version. so i’m sorry, well i meant LIGHTBOX :slight_smile:

I tried to add :

$w("# gallery1 ").show(“fade”);

to the code to get what you suggest but it changes nothing :frowning:

I emptied the browser cache and tried different browsers (firefox, chrome, edge).

Maybe i have misunderstood the states (collapsed - expanded) of a gallery ?

My guess is, this is “collapsed” :

here, “expanded” = the result of clicking on the main item:

and this is full screen, that is not a “velo accessible” state i think :

Maybe I need to create a sort of callback function on the lightbox opened event at the root page to trigger the click event?

Thank you a lot in advance for you help !

Here you will find all informations about the possibilities of a gallary.
https://www.wix.com/velo/reference/$w/gallery

Further pay attention, that not every gallery provides the same functions.
Out of my experience "Pro-Gallaries are not very flexible and do not really provide options for customization or interactions.

The question is: Is a REPEATER maybe even the better GALLERY?
Just an idea of doing out of a repeater a gallery, when combining repeater and wix-animations? Would this work?

Ok thank you very much !

Repeater + wix-animation would be a lot of work
it’s frutstrating when i know the pro gallery graphically exactly does what i want out of the box and is supposed to expand with the function expand()

I did not choose wix to have a lot of work :wink:

I can confirm this must be a bug / limitation because :

$w . onReady ( function () {
console . log ( $w ( “#gallery1” ). collapsed );
$w ( “#gallery1” ). collapse ();
console . log ( $w ( “#gallery1” ). collapsed );
$w ( “#gallery1” ). expand ();
console . log ( $w ( “#gallery1” ). collapsed );
})

returns :

false
true
false

  • nothing happens

and i expected / it should be :

true
true
false

  • finally fire the nice expanded view !

thank you for time and your help
i stop searching for a solution

Most out of the box provided solutions are nice, but do not really support customization-options. So in about 80% of all situations, you will have to go your own custom way, if you want more then the provided features and functions by wix.

You have still the possibility to use a CUSTOM-ELEMENT to create your own working GALLERY or do it within an HTML-COMPONENT.

And like already mentioned, doing it out of a combination between repeater and wix-animations (but never tried it, just an idea).

You wants to build a nice and individual looking and working site, in most cases you will have to do your own creations in wix using code.

The more invested time = the better the site.

Thank you very much for your support :slight_smile:
To be honest with you, i finally went on searching and made it really dirty with custom code by triggering clicking on the gallery when the dom has changed :

i will just try to improve it with detecting the lightbox ready instead of the ugly settimeout method

In a sense, i’m happy to see that wix is so flexible to accept such a “thing”

no comment please :joy: