I have a Collection List with a list of hotels.
On a page, I show short info (photo and name) about all hotels from my collection list. By clicking on the hotel photo I want to show pop-up with a video about the corresponding hotel (I made that using html-embed because my video locates on my server).
I added Collection List to the page, put photo+hotel name inside Div Block.
But when I add a mouse click on the photo of any hotel, this interaction applies to photos (list items) of other hotels from my list. How can I open different popups when I click on different items (photos) from my collection list?
Okay, everything must be inside of your collection item element: the content of the item, the click trigger, the model and its content. Like for example:
col item
â col item content div
â col item trigger for the video modal â IX on this
â modal and its content â so this is a SIBLING of the trigger
Now you will limit the IX to .class and SIBLING
So the url of the video or whatever is in the modal should somehow be part of the CMS.
But then you will need ONE only IX and to design ONE only modal. How sweet isnât it?
Once youâll have understood this principle, youâll understand what you can achieve with IX by using the actions limitations, and how your structure makes an IX possible. For IX targeting Collection List Items, you have to think the structure ahead.
Amazing! It works! Thank you so much!
Just one trifle left â is it possible to keep that video autoplayed? I forced it to autoplay using a small js-code for the whole site, but after the last changes, it doesnât work. It is not so important, but if there is a quick solution it will great.
Okay⌠logically, you should alway use some sort of JS code or a Youtube API to play videos when thereâs multiple of them, unless your page will become slow. Using code or an API allows you to use only one player thatâs repeated for all the videos, and to handle play, stop, loop etc⌠Especially, thatâs useful to prevent a video continuing playing when another is started.
So the best practice in your position is to use more code, not less code, to make sure your video behave as the user expect them to and to keep your page as light as it should be.
Canât help you further on this as I am not a coder.