Whitespace issue at the end of slider
See original GitHub issueMy carousel container is 400px wide, each slide is 100px wide and in total there are 10 slides. In my settings, I have it set to scroll 4 slides at a time. When I reach the end of the slide, there is undesired whitespace there.
JSFiddle
http://jsfiddle.net/238598/drdydokx/1/
Steps to reproduce the problem
Use the following settings
$(".slider").slick({ dots: false, slidesToShow: 4, slidesToScroll: 4, autoplay: false, infinite: false, variableWidth: true, centerMode: false, initialSlide: 0, });
What is the expected behaviour?
When clicking ‘next’ arrow, the slider should check whether there are 4 slides to scroll? If so, go ahead, if not, then scroll the remaining slides.
What is observed behaviour?
When clicking ‘next’, it scrolls through 4 slides at a time even when there might be just 2 slides left to scroll.
More Details
This issue is present in 1.5.9 version of slick.js Tested in Chrome 48.0.2564.116 for Mac
Issue Analytics
- State:
- Created 8 years ago
- Comments:17 (2 by maintainers)
Top GitHub Comments
Sure! http://jsfiddle.net/drdydokx/26/ I think the proper behaviour would be to limit the movement when the last element has reached the right side, so we can avoid that unwanted white space
This worked for me
.slick-initialized .slick-slide { display: flex; justify-content: center; }