Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show half of next slide without Center Mode in Slick Slider

What I want is to have a slider that shows 3.5 slides at once, with the right most slide being the one that is only half shown. I have seen something like this done successfully using centerMode and centerPadding with slick slider, but I do not want the slides to be centered. In other words, I want the left most slide to be flush with the side of the window, totally in view, but the right most slide to be half in the window, half off. Is this possible in slick? I've seen people using slidesToShow: 3.5, but this makes the left most slide go half off the screen and I need it on the right.

like image 451
Cook88 Avatar asked Jan 28 '17 01:01

Cook88


2 Answers

No need to add "slidesToShow: 3.5 option"

Just call slick:-

$('.Your-container').slick({     arrows: false, }); 

and add following CSS:

.slick-list{padding:0 20% 0 0 !important;} 

Either you can give a fixed padding to the right or percentage.

like image 82
Abdul Rahman Avatar answered Sep 18 '22 08:09

Abdul Rahman


You can do something like this slidesToShow: 3.5 and make infinite: false. The right most slide will be showing half.

like image 38
kophygiddie Avatar answered Sep 20 '22 08:09

kophygiddie