Ganesh Kumar G Ganesh Kumar G - 1 year ago 297
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,

slidesToShow: 3,
slidesToScroll: 1,
dots: false,
arrows: true,
infinite: false,
centerMode: true


Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download