kenwheeler / slick

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

Vertical slider responsive height #3284

Open semihkaragozoglu opened 6 years ago

semihkaragozoglu commented 6 years ago

Hello, i have been using this slider for 8 months already thanks very much

Im trying to do Vertical slider, but i cant set slidesToShow option. height of .slick-list and .slick-slide items can be variant.

here is my fiddle https://jsfiddle.net/75ouf2pg/4/

is there a way to set slidesToShow auto.

best Regards

ahmadalfy commented 6 years ago

I think the best solution for you is to use centerMode and to increase the height of your container like the following: https://jsfiddle.net/75ouf2pg/5/

pgooood commented 5 years ago

I had the same issue, fixed one like this: I replaced this part of code

if (_.options.vertical === false) {
        targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
} else {
        targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
}

with this one

if (_.options.vertical === false) {
    targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
} else {
    var scrollHeight = 0;
    for(var i = 0; i < slideIndex; i++)
        scrollHeight+= _.$slides.eq(i).outerHeight(true);
    targetLeft = (scrollHeight * -1) + verticalOffset;
}
tpzwt commented 5 years ago
targetLeft 

Where add this code ?