Slick: Question: Remove padding from first/last scroller-item in 'centerMode'?

Created on 3 Jun 2015  路  5Comments  路  Source: kenwheeler/slick

I noticed when centerMode enabled, there is a 50px padding adding to the right and left side of the 'slick-list' element. However, this causes unnecessary extra white space on the left side of the first scroller-item element and the right side of the last scroller-item element. Is there a way to remove this extra whitespace?

Most helpful comment

Setting centerPadding to '0px' fixed my problem.

All 5 comments

Here's an example:

http://jsfiddle.net/ejwaibel/fjg17efL/3/

Notice the extra white space on the left side of the first slide and right side of the last slide.

You can set negative margins on the container to fix this.

Does anyone have an elegant solution?

Setting centerPadding to '0px' fixed my problem.

Setting centerPadding to '0px' fixed my problem.

Disappeared when centerPadding set to 0px and solved using centerPadding set to 1px

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Luneya picture Luneya  路  3Comments

REPTILEHAUS picture REPTILEHAUS  路  3Comments

yangkennyk picture yangkennyk  路  3Comments

rahi-rajeev picture rahi-rajeev  路  3Comments

jeremymandel picture jeremymandel  路  3Comments