F
F
freeman02042018-09-14 10:36:33
css
freeman0204, 2018-09-14 10:36:33

How to get rid of the "jumping" photo when loading slick?

There is a slick slider in which the photo is of different proportions and sizes, I limit the img in height and stretch the photo through object fit: cover. When the site loads for a couple of seconds, the photos, as if without a slider from top to bottom, go in their usual size, and only after a couple of seconds they fall into place in the slider and are cut off. Can the priloader help, but are there other options?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Alekseev, 2018-09-14
@shure348

.slider_wrap > .slider_item:nth-child(n+2) { display: none; }

hide all slides except the first one
, if the slick is initialized, this selector will no longer work

M
Merrii, 2018-09-14
@Merrii

Use background-image instead of img and set a fixed height on those divs. Alternatively, wrap the img in a div and give it a fixed height.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question