center mode not working when slides are equal to slidesToShow
See original GitHub issueHi, I’m using slicker but I have a problem.
I have:
<div class="thumbnail-gallery-container">
<div class="thumbnail ">
<img src="../images/one.png" alt="pic_one" />
</div>
<div class="thumbnail ">
<img src="../images/two.png" alt="pic_two" />
</div>
<div class="thumbnail ">
<img src="../images/three.png" alt="pic_three" />
</div>
</div>
$thumnailContainer.slick({ slidesToShow: 3, slidesToScroll: 1, arrows: true, infinite: true, dots: false, centerMode: true, focusOnSelect: true, variableWidth: true });
The problem is that when I have the same number of slides and slidesToShow, the div “slider-track” have an inline style of “transform: translate3d(137px, 0px, 0px);” and that makes that this is not center.
This is how it look
But when I have 4 slides and slidesToShow = 3, it looks fine:
Is there any way that I can make this 3 slides respect the center mode and not adding the "“transform: translate3d(137px, 0px, 0px)” when numberOfSlides == slidesToShow ??
Thank you!!
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
Slick slider centermode not working when more slides than ...
slide elements) is less than or equals to the value of the slidesToShow option, the slides will not be cloned and the centerMode...
Read more >Center mode doesn't show next and previous slide - Drupal
Hi gausarts! I managed to make it work but for anyone having the same problem: Other relevant settings: Center mode = ON Infinite...
Read more >slick - the last carousel you'll ever need - Ken Wheeler
... centerMode: true, centerPadding: '60px', slidesToShow: 3, ... To use lazy loading, set a data-lazy attribute // on your img tags and leave...
Read more >Slick slider center mode with 2 slides. Number of Slides to Show
Working fiddle here: Slick slide - two slides in center mode Share Follow ... new syntax center mode not working when slides are...
Read more >kenwheeler/slick - Gitter
Has anyone else had the same problem? Karolína Vyskočilová ... i have a small probleme on slick slider with max-width of slick-slide ......
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
Hi, I fixed this problem with some css !!
.slider { width: 80%; margin: 100px auto; }
.slick-slide { margin: 10px 20px; }
.slick-slide img { width: 100%; transform: scale(0.9); }
.slick-prev:before, .slick-next:before { color: black; } .slick-dotted .slick-center img { transform: scale(1.1);
}
@flinch85 @laurentmor
Hello, this problem still stands. Any fix yet? Thank you!