Slider in infinite mode not creating clones when slidesToShow === slideCount
See original GitHub issueExpected behavoir: when initial code looks like this:
<div id="slider">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
<script>
$('#slider').slick({ slidesToShow: 3, slidesToScroll: 1 });
</script>
then generated code should look like this:
<div id="slider">
<div class="slick-cloned">1</div>
<div class="slick-cloned">2</div>
<div class="slick-cloned">3</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div class="slick-cloned">1</div>
<div class="slick-cloned">2</div>
<div class="slick-cloned">3</div>
</div>
currently there are none of slick-cloned
elements generated if slidesToShow === slideCount
my dirty fix was to replace this _.slideCount > _.options.slidesToShow
with _.slideCount >= _.options.slidesToShow
which fixes my issue … but i would prefer correct fix …
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:7
Top Results From Across the Web
Force cloning slides in slick - Stack Overflow
In my case I have a slider with filters, when the filtered elements are the same as the elements to be displayed, the...
Read more >Options - Splide
Explicitly determines the number of clones on each side of the carousel ... Determines how many pages (not slides) around the active slide...
Read more >Untitled
slider .children( _.options.slide + ':not(.slick-cloned)') .addClass('slick-slide'); _.slideCount = _.$slides.length; _.$slides.each(function(index, ...
Read more >Slick Slider Example - CodePen
Here's an example of an image carousel using Slick Slider. This example has a couple breakpoints to illustrate it's responsiveness....
Read more >React Slick Doesn't Loop Slides If Slidestoshow Is Equal to the ...
Slider in infinite mode not creating clones when slidesToShow slideCount.Original URL.Expected behavoir: when initial code looks like this:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We had a similar issue like this: if slideCount <= slidesToShow and initialSlide > 0, all slides before initialSlide will be hidden.
Actually we can accept that no cloned slides is generated in this situation, but it’s really a big problem that some slides are hidden. The reason is the incorret value of transform in style of slick-track element.
We do a tricky hotfix:
you cannot set the slide with or max-width, I removed that and fixed it. as the slider defines the width of each slide