G
G
gretyl0072019-08-20 21:15:17
Slick
gretyl007, 2019-08-20 21:15:17

How to set different widths for slides in slick slider?

Actually, the question itself is in the topic title. How to make the center slide the largest, slides on the right and left smaller?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
y0u, 2019-08-20
@y0u

JS:

$('.slider').slick({
    centerMode: true
});

CSS:
.slick-current {
    transform: scale(1.3);
}

I
inkShio, 2019-08-20
@inkShio

the site has an example with center mode.
as an option to increase the content of the current container.

<div class="slick-slide"><div class="container-content">слайд 1</div></div>
<div class="slick-slide slick-current"><div class="container-content">слайд 2</div></div>
<div class="slick-slide"><div class="container-content">слайд 3</div></div>

in css
.slick-current > .container-content {
  transform: scale(2);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question