fancyapps / ui

A library of JavaScript UI components, includes the best lightbox - Fancybox5
https://fancyapps.com/
Other
784 stars 98 forks source link

Carousel #29

Closed AlexJMcloud closed 3 years ago

AlexJMcloud commented 3 years ago

Installed the carousel. Scrolls with a large white space. Something went wrong??? 2 1 myCarousel = new Carousel(document.querySelector("#carousel"),{slides: slide,'dragFree':true});

fancyapps commented 3 years ago

Hi,

Please, provide additional info, a live demo would help to give a proper answer. You can easily create a demo here - https://fancyapps.com/playground/ - buy you can use any other similar service (Codepen/Codesandbox/etc).

Basically, you control the width of the slide using CSS. For example, in this demo - https://fancyapps.com/playground/g9 - each slide has a width of 30%. Images are large enough to fill the slide and they have a maximum width of 100%, so that they are responsive.

AlexJMcloud commented 3 years ago

Hi,

Please, provide additional info, a live demo would help to give a proper answer. You can easily create a demo here - https://fancyapps.com/playground/ - buy you can use any other similar service (Codepen/Codesandbox/etc).

Basically, you control the width of the slide using CSS. For example, in this demo - https://fancyapps.com/playground/g9 - each slide has a width of 30%. Images are large enough to fill the slide and they have a maximum width of 100%, so that they are responsive.

Thanks for the example. I have corrected my code and there are no such failures. I think this example should be placed in the documentation. It will be useful to many.

AlexJMcloud commented 3 years ago

It only remains to understand how to align the photo horizontally. They are different in height.

fancyapps commented 3 years ago

Since slides are flex items, you can easily align content as you need. Also, all slides will be the same height, except for virtual slides.

btw, if you wonder how to combine everything, here is a quick demo - https://fancyapps.com/playground/pL