kenwheeler / slick

the last carousel you'll ever need
kenwheeler.github.io/slick
MIT License
28.34k stars 5.88k forks source link

Lazy loaded images do not necessarily load if a filter is applied. #1224

Open mgleahy opened 9 years ago

mgleahy commented 9 years ago

If I have lots of lazy-loaded images in a slick carousel, and when a filter is applied to the carousel, newly displayed images are not always loaded. A quick fix for this was to change one of the lines in the lazyLoad function from:

loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);

to

loadRange = _.$slider.find('.slick-slide.slick-active');

That seems to ensure all visible images are loaded.

iworker commented 9 years ago

@mgleahy ty for quick fix. Hope my issue must be linked with this: #1225

mgleahy commented 9 years ago

If that is a sufficient fix, then the lazyLoad function might be able to be abbreviated if the rangeStart and rangeEnd parameters are no longer needed.

I'm not sure what other implications that change might have, but it works for my scenario.

marlonbernardes commented 9 years ago

:+1:

cansozeri commented 9 years ago

it have to be merged or fix it other way ... But there is no answer for this bug like the others ...