slick icon indicating copy to clipboard operation
slick copied to clipboard

lazyLoad working with progressive but not with ondemand

Open blinkcursor opened this issue 9 years ago • 14 comments

I have 2 pages using slick, one uses lazyLoad: "progressive", the other uses lazyLoad: "ondemand" which fails to work, it doesn't appear to load any images.

If I switch the 2nd page to lazyLoad: "progressive" it works as expected.

I wasn't able to reproduce with jsfiddle but I got it working on codepen: http://codepen.io/anon/pen/Nqwbjr

In the example it is set to ondemand and nothing happens. If you change it to progressive, the images will load.

blinkcursor avatar Jun 23 '15 15:06 blinkcursor

I have the same problem with lazyLoad. Any fix for this problem?

thanks!

silicht avatar Sep 09 '15 18:09 silicht

Came here looking for help with the same problem... I think I have figured it out.

It seems that slick + ondemand lazyload don't play nicely with img elements as immediate children of your carousel container. The fix is to wrap each img element in its own div.

ssnepenthe avatar Oct 22 '15 02:10 ssnepenthe

I also have this issue.

Mentioum avatar Jan 07 '16 07:01 Mentioum

Updated from 1.5.0 to 1.5.9 today to fix the issue where the slider doesn't start rotating after the mouse leaves. I have lazy-load: ondemand set and the first image wouldn't load. When the second image loads everything loads thereafter. I have each img element wrapped in it's own div.

lazy-load: ondemand seemed to work correctly in 1.5.0 but not 1.5.9. I ended up setting lazy-load: progressive and I see the first image just fine. This is better than not seeing the first image, but not ideal.

On a side note, thanks for giving us such an outstanding slider. It is the only one I need.

Thanks.

davehallowell avatar Jan 21 '16 21:01 davehallowell

@davehallowell same issue here

mcclaskiem avatar Apr 16 '16 21:04 mcclaskiem

it works when you wrap with a div.

yanwsh avatar Jun 01 '16 22:06 yanwsh

I have the same problem here, onDemand not working. :( my options { lazyLoad: 'ondemand', slidesToShow: 1, slidesToScroll: 1, dots: true, infinite: true, variableWidth: true }

rafaelboschini avatar Jun 20 '17 18:06 rafaelboschini

Veio aqui à procura de ajuda com o mesmo problema ... Acho que descobri.

Parece que slick + ondemand lazyload não joga bem com elementos img como filhos imediatos do seu contêiner de carrossel. A correção é envolver cada elemento img em sua própria div.

Isso funcionou perfeitamente para mim!

MuriloEduardo avatar Oct 09 '18 18:10 MuriloEduardo

same bug

albirrkarim avatar Mar 23 '20 06:03 albirrkarim

Same here

AmeenJalali avatar Apr 22 '20 11:04 AmeenJalali

Same here, in my case, the IMAGE is wrapped on a PICTURE tag with sources and the image won't load, stay with data-lazy attribute.

Giovancruz avatar Sep 10 '20 00:09 Giovancruz

This still isn't fixed? 7 years later? I know you can wrap a div around each of your images and it works but that's just a hack/workaround...

webdev69420 avatar Jun 02 '22 15:06 webdev69420

Same problem...

maieul avatar Aug 18 '23 16:08 maieul

Just figured it out. Couldn't make it to work until I replaced <img src="your.url"> with <img data-lazy="your.url">

Now it works like a charm!

fsdevlalo avatar Feb 20 '24 22:02 fsdevlalo