P
P
Polina Emelyanova2018-03-02 19:16:34
JavaScript
Polina Emelyanova, 2018-03-02 19:16:34

Why does the Slick Slider clip the height of the active slide on centerMode?

Good afternoon, colleagues.
Has anyone encountered such a problem.
SUBJECT:
There is a Slick slider with its centerMode set.
The active slide must be larger than the "ordinary" one. What is transform used for: scale(1.5);
PROBLEM:
Active slide clips in height.
The height of the slider is measured from a value I don't understand.
Please help me solve the issue.
Codepen
It should be like this
5a997a51de2d8364254879.jpeg
It turns out like this
5a997edfd79c8767152054.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
its2easyy, 2018-03-03
@bugo_aneo

Slick considers the height without taking into account the scale, and overflow: hidden hangs on the .slick-list block, which cuts to height.
You can add padding-top and padding-bottom to .slick-slide so that the height of each slide becomes equal to the desired height of the central slide with the enlarged image, then the image after scale will take up free space

B
BB 8, 2018-03-02
@fruity4pie

5a99827b65f11439382203.png
From this value, the height of the centered slider is calculated:

<div class="slick-slide slick-current slick-active slick-center" data-slick-index="0" aria-hidden="false" style="width: 573px;" tabindex="-1" role="option" aria-describedby="slick-slide00"><img src="https://pp.userapi.com/c837322/v837322210/33ccb/saIIiGQzX7g.jpg" alt=""></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question