Lazy loading of type 'ondemand' fails to load some visible slides in certain situations
All visible slides should be lazy loaded when the slick initializes
There are visible slides to the left of the "currentSlide" that do not get lazy loaded during init
The fix is to use rangeStart = _.currentSlide - Math.max(0, _.currentSlide + _.options.slidesToShow - _.slideCount); when infinite and centerMode are false. I'll submit a PR when I get a chance.
This sounds related to #2110, which I made a PR for here #2164, but when I tested the PR against your fiddle, I found a bug with scrolling--cant get to slide 1. Thanks for the issue @rphelan. I look forward to your PR.
@rphelan @leggomuhgreggo Was there ever a PR sent in for this? Having the same issue
@rphelan I've been trying to figure this bug out for a little bit now. For some reason converting the lazyLoad function to use Jquery made it work everytime for me, as well as Implenting an additional conditional to handle the infinite option at a higher level.
Also not sure if this makes any sense but before I changed the function over to jquery I was able to get the original way to work by adding a console.log directly after the img tag creation. Is there some sort of race case at play here and delaying the function a little more caused it to work? Seems pretty bizarre to me.
@mcclaskiem Sorry, I forgot about this one, working on a PR now. I do not expect it to fix the scrolling issue that @leggomuhgreggo mentioned though as I think its separate (although caused by the same combination of settings).
Any updates on this?
Most helpful comment
2255