hongaar / unveil2

:mount_fuji: A very lightweight jQuery plugin to lazy load images
http://nabble.github.io/unveil2
38 stars 11 forks source link

Unveil never or unreliably triggers inside carousels, dropdowns. #23

Open Antman261 opened 7 years ago

Antman261 commented 7 years ago

I've been using unveil successfully across an entire site, however when using an img tag inside a carousel, (specifically nivoslider) unveil loads the placeholder pixel and only switches to the src if a scroll is triggered while the image is displayed in the carousel.

If I use a div it will set the background image from data-src or breakpoint-src immediately, this issue seems to be specific to img tags.

Could unveil instead more reliably check that a parent element is visible? Even better if we could set the trigger element via a data attribute, that way I could get unveil to load the entire carousel as soon as it appears on screen, ensuring transitions animate correctly.

hongaar commented 7 years ago

Thanks for this. Could you provide an example of this behaviour on i.e. jsFiddle?