kenwheeler / slick

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

Lazy Load + Fade #1583

Open fernicolosi opened 9 years ago

fernicolosi commented 9 years ago

Hi!

First of all would like to thanks for this great plugin and the constant support and improvement. So far it's been my fav carousel already used in several projects.

I came up with some issues that would be great to find some workaround... When I'm using the "lazyload" option and at the same time "fade", it doesn't work as expected, seems that lazyload functions disable, or work unexpectedly. I did tried to start the carousel with the fade set to false, and once all the site is loaded slickSetOption the fade to true. It works quite well but when you resize your screen the carousel width doesn't adapt.

$(document).ready(function () {

var carouselBlock = $(".boxGallery"),

carouselBlock.each(function () {
    var $this = $(this),

    $this.slick({
        fade: false,
        speed: 1400,
        inftinite: true,
        pauseOnHover: false,
        arrows: false,
        autoplay: true,
        lazyLoad: 'ondemand'
    });
})

    $(window).load(function () {
        carouselBlock.slick('slickSetOption', 'fade', true);
    })

})

Thanks for the help and support!

leggomuhgreggo commented 8 years ago

Hey, I'm closing because there's no test-case, per the contribution guidlines, but if you make one we could possibly reopen. Thanks!

jpannone commented 8 years ago

Let's reopen... I've seen this issue a few times on different projects. Test case below: http://codepen.io/jeffpannone/pen/NNyWJz?editors=1000

I have four slides and all but the last have downloaded on page load: image

kaalis commented 7 years ago

Typo in first posts example; inftinite -> infinite.