Hello everyone, i am trying to do a simple thing (for it’s just to dumb to not work) : add an onclicked event on a progallery (diaporama, slides, so this has the capacity to be playable), to see the next image of my gallery , but i can’t figure it out with it. I saw previous posts saying the pro gallery was buggy, but i didn’t think of that.
My pro gallery :
On settings :
On click : no action (or it will open me something else, like a fullscreen picture)
dowload, heart icon, share : disabled
On design :
Navigation arrows : disabled
On advanced :
video playing : on automatically
If you can please try with me to figure it out, i don’t know what is wrong.
The code is bellow, and the console.log does display “galleryClicked”.
You have two event handlers to handle the event of item being clicked. Do you have gallery1_itemClicked() connected in the Properties panel to the Gallery? If not, it won’t run. Which of the two do you want to use? Having two definitions for the same event handler will result in unpredictable behavior.
Using just one of them (the one in the onReady() function), your code should look something like this (untested):
When an item is clicked, it triggers onItemClicked(). You will then see “galleryClicked” displayed in the console, and the gallery should then go to the next item.
@yisrael-wix Ok weird it’s not working, it’s sliding, so should get independant items and shoulde be playable ! i wanted to keep the full screen image diaporama, but it’ll try with others templates so … Thanks for your help, sad that it doesn’t work with that ^^
Actually, it will be useful to get a list of what kind of progallery is playable ! Because it seams that all of them aren’t playable ! Does it means i need to use something else than Pro Gallery ?
@edouard One of the screen elements - not the app store.
Editor X is new and is still in Beta, so it might not yet support all of the galleries that are available in the classic Editor.
I’m not really sure what all is available on EditorX. I would suggest r eaching out to Wix Customer Care as they’ll be able to help you on this better than I can.
i contacted support and no response yet, i’ve tried the same code on the “normal” wix editor and it still not work on gallery pro, any further ideas ?
Do i need to put something else in the code ?
export function gallery1_itemClicked(event) {
$w("#gallery1").next(); // is that really $w("#gallery1") that i need to use ? or something like $w(galleryitem) or else
}
@edouard It won’t work on the Pro Gallery in either Editor. The Pro Gallery API is very limited. You will need to use one of the other available Galleries, but I’m not sure if they’re available in Editor X.
If you were on the Classic Editor, I would suggest using a Slide Show to create a gallery. You can check on the Editor X Community Forum and ask there what your options are.