Ganesh Kumar G Ganesh Kumar G - 1 month ago 23
Javascript Question

Disable next/prev partial view in center mode slick slider

I want to use center mode in slick slider but need to avoid partial prev/next slides. (Just show the three main divs only)

My settings is like this,

$('.framefitFacelist').slick({
slidesToShow: 3,
slidesToScroll: 1,
dots: false,
arrows: true,
infinite: false,
centerMode: true
});


Thanks.

Answer

Hi you can change this with javascript. You have to set the opacity of the partial slides to 0;

Essentially you can create a variable and set prev and next slide opacity to 0 when concatenating css and then call the beforeChange slick event.

I found this fiddle that seems to achieve what you are looking for.

test it out

https://jsfiddle.net/yassarikhan786/uwgjx6nv/