kenwheeler / slick

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

All Dots do not display when Slides to Show is not a divisible #1678

Open MikeIsHereWorking opened 9 years ago

MikeIsHereWorking commented 9 years ago

So a picture is worth a thousand words

http://jsfiddle.net/3aodk57c/

We have a carousel that was using slick 1.5.0 and there are three slides and it would have three custom dots. When we upgraded to 1.5.7, for the issue with the autoplay pause issue, there now is only 2 dots but 3 states (AB, BC, CA)

So if you change the demo above by switching to slick 1.5.0 OR changing the slidesToShow to 1 then it works as expected.

MikeIsHereWorking commented 9 years ago

I tried modifying the example to 4 slides, thinking that 4 is divisible by 2 and it should work. But it does not. The last dot is always missing.

http://jsfiddle.net/78ykzcnv/

MikeIsHereWorking commented 9 years ago

Just to note I put the .getDotCount function back to the 1.5.0 implementation

so changed

    if (_.options.infinite === true) {
        while (breakPoint < _.slideCount) {
            ++pagerQty;
            breakPoint = counter + _.options.slidesToShow;
            counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
        }

back to

if (_.options.infinite === true) {
        pagerQty = Math.ceil(_.slideCount / _.options.slidesToScroll);
}
shaekuronen commented 9 years ago

Worked, thanks @MikeIsHereWorking!

philipdowner commented 9 years ago

Any ideas when this will be fixed in an official release?

Thorazine commented 9 years ago

I think it's the same bug in the demo @ Slider Syncing: http://kenwheeler.github.io/slick/ 2 dots are missing. In my program there are always the last four missing for some reason.

MikeIsHereWorking commented 8 years ago

Note that my fix does not work and breaks when slides are vertical.

Just found that out today....

Correction: vertical slides does not work with 1.5.7 but does work with 1.5.8