question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Whitespace issue at the end of slider

See original GitHub issue

My 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:closed
  • Created 8 years ago
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
jfcartiercommented, Apr 27, 2017

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

3reactions
isahohiekucommented, Nov 24, 2020

This worked for me

.slick-initialized .slick-slide { display: flex; justify-content: center; }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slick Carousel whitespace issue at the end of slider - CodePen
Insecure Resource. The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https....
Read more >
Owl Carousel Loop Issues, whitespace when reaching end ...
The expected behavior would be that the leftmost slide remains purple, but it turns black, the color of the slide incoming. enter image ......
Read more >
Empty white space appears between slide and dots - Drupal
Every time a page is refreshed, there is an large empty white space that appears between the slider and the navigation dots.
Read more >
Slick Slider plugin issue - jQuery Forum
I am facing the white space issue at the end of the last slide in slick slider carousel. It would be great if...
Read more >
Empty space where the slider should be
The most common cause if this error, that the CDN cache is not cleared. If you are using CDN, make sure you clear...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found