kenwheeler / slick

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

Images with different heights break a vertical carousel #2272

Open NexusNull opened 8 years ago

NexusNull commented 8 years ago

http://jsfiddle.net/fmo50w7n/322/

Steps to reproduce the problem

  1. Have a Vertical carousel with images.
  2. All images should have different height.(Big difference = great discrepancy)
  3. additionally: enable centermode.

    What is the expected behaviour?

When the slider moves, the center slide should stay in the center.

What is observed behaviour?

As long as the height difference of those images is small the only problem is that the current slick slide is a little of center. As soon as the difference get to big the center Slide is no longer visible and the track element starts to bug out and goes of screen completely.

leggomuhgreggo commented 8 years ago

Hey @Fansana, firstly, thanks for making the issue. What you're saying definitely makes sense. Unfortunately support for vertical mode is pretty limited at this stage.

Right now, I think the height of the track is calculated by taking the height of the first slide and multiplying slidesToShow and the track moves by the height of the current slide, which is set to auto and adjusted to slide content--the upshot is there's no support currently for dynamically centering of variable height slides.

Setting a fixed height for the slide might help your situation though. Hope that helps!

Related to #1803 and #1852