Streaming live at 10am (PST)

Jquery help to remove empty thumbnails


#1

Hey,

I have an issue whereby I’m populating a lightbox using a cms list and it works fine. However, if some cms fields aren’t populated, a blank thumbnail appears in the lightbox thumbnail list at the bottom of the screen. I’ve made a jsfiddle out of it and I’m looking to find a solution that removes lightbox thumbnail which are empty.

https://jsfiddle.net/diarmuids/atwz8dy1/

Open the JsFiddle and Run. Then click “more photos from the event” to see what I’m talking about

Any help would be greatly appreciated!

Thanks in advance


#2

Hi,

Please check PM,

Regards,
Hayden


#3

Hi @Diarmuid_Sexton,

Could conditional visibility help you there ?
Not sure if that is what you’re looking for though.


#4

Hi @anthonysalamin,

Thanks for taking the time to answer but no - it won’t work in this situation as what I’m using is custom code.

However, I found the jquery

$(":not(.w-lightbox-item:has(img))").remove(".w-lightbox-item");


#5

Well that’s really interesting indeed, thank you for sharing that bit of code !


#6

Hey Man,

thanks for your code! However if I implement it into the embed html,
the Lightbox won’t open anymore. Do you have an idea?

Thanks in advance!