metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.52k stars 605 forks source link

How can I make the carousel resize based on image size? #823

Closed marbuser closed 6 years ago

marbuser commented 6 years ago

I'm trying to achieve something similar to the graphic below. Blue = Carousel Slides (As Images) Green = Carousel Frame/Viewport/Container Red = Visible Page (1440) image

I have 5 images, all with the same resolution of (1024x576), and I want them to maintain their ratio while scaling up/down based on screen size.

I've spent several hours on this now and I've been unable to achieve what I want, so this is the only place I figured I could ask for help.

I DO NOT want to use some fixed height like is shown in a majority of the demos on the website, since it becomes problematic when scaling down to smaller devices.

The reason I post this question is because any time I try and use anything OTHER than a fixed height, the entire carousel collapses, even with adaptiveHeight: true, and/or setGallerySize: false.

Any help is appreciated.

desandro commented 6 years ago

I'm sorry to see you're having trouble with Flickity. Could you provide a reduced test case? See Submitting Issues in the contributing guidelines.