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.

When `centerMode` is set to true the `slidesToScroll` property setting is ignored.

See original GitHub issue

Description

When centerMode is set to true the slidesToScroll property setting is ignored.

JSFiddle

http://jsfiddle.net/whoacowboy/g2sozm65/1/

Steps to reproduce

  1. Using the centerMode code from you demo page create a jsfiddle
  2. Add the slidesToScroll:3 to you properties, hit run

Expected behavior

I would expect the carousel to slide 3 slides when i hit the arrow or swipe the carousel.

Observed behavior

The carousel slides only one slide.

More Details

  • Which browsers/versions does it happen on? Chrome, FF, Safari Latest
  • Which jQuery/Slick version are you using? 1.6.0
  • Did this work before? ?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:10
  • Comments:37

github_iconTop GitHub Comments

19reactions
Choufouraxcommented, Mar 11, 2018

If you want to force the use of slidesToShow with centerMode, you do not need to change the core code. I did it like this :

// 1 - init
$('"#carousel").slick({
	centerMode: true,
	infinite: true,
	slidesToShow: 3,
	speed: 500,
	variableWidth: true,
	accessibility: true
});
// 2 - force slidesToScroll in centerMode
$('"#carousel").slick('slickSetOption', 'slidesToScroll', 3, true);

This works for me but please notice :

  • do not use this with focusOnSelect set to true or you will have the bug describe on this thread
  • a real core fix would be better and greatly appreciate
7reactions
Carlovancommented, Apr 10, 2018

Could you please remove that check? I think if we notice something wrong when using centerMode we can just set slideToScroll=1 ourselves.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slick carousel in Center Mode causes SlidesToscroll does not ...
js), I would like to use centerPadding so I have to set centerMode to true. After I turn CenterMode on, I swipe the...
Read more >
Center mode doesn't show next and previous slide - Drupal
I am using the 7.x-2.0 version of the slick module and the 1.5.9 version of the library because of a problem with the...
Read more >
slick - the last carousel you'll ever need - Ken Wheeler
Hi thekenwheeler!. I used the slick.js library for swipe functionality. I want to control the slidesToScroll property based clicks on arrow buttons. If...
Read more >
https://www.aamu.edu/_resources/ldp/galleries/slic...
Data Attribute Settings In slick 1.5 you can now add settings using the ... Unless `autoplay: true`, sets browser focus to current slide...
Read more >
kenwheeler/slick - Gitter
infinite: true, dots: false, slidesToShow: 7, slidesToScroll: 1, centerPadding: '0px', centerMode: true, variableWidth: false, draggable: false,
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