malsup / cycle2

2nd gen cycling
899 stars 236 forks source link

Carousel Fluid - Responsive Width Bug #465

Open Ne-Ne opened 10 years ago

Ne-Ne commented 10 years ago

Hi,

First what a great slider, easy to use and worth the download!

My issue is with the responsive carousel option. My code below is correct and runs correctly. However when there are 4 items visible and, the viewport width changes to a number which is not divisible by 4 there is a bug:

1010 / 4 = 252.5

The browser cannot render half a pixel hence the image does not appear, admittedly I have got overflow hidden and a set height, but if its a slider there is good cause to add it.

<ul id="mag-list" class="download-list" data-cycle-slides="li" 
                data-cycle-fx=carousel
                data-cycle-timeout=0
                data-cycle-carousel-visible=4
                data-cycle-next="#next"
                data-cycle-prev="#prev"
                data-allow-wrap=false
                data-cycle-carousel-fluid=true>

Could cycle2 add add a padding left and right to the ul, in order to produce a whole pixel for each "data-cycle-carousel-visible" item?

lohkemper commented 5 years ago

I have this bug too.

In my Case i have carouselVisible: 4 and carouselFluid: true. My Container 671px width My Slide 168px (in Browser) My Calc 671px / 4 slides = 167,75px

Revers: 168px * 4 = 672px and 672 > 671 = wrap befor latest element

I have simple add CSS: .cycle-carousel-wrap { right: -3000px; }

( The Problem is NOT in http://malsup.github.io/jquery.cycle2.carousel.js Line ~159 )