N
N
naraxis2017-08-21 14:37:20
Slick
naraxis, 2017-08-21 14:37:20

Slick slider sets image width to 0, how to fix?

There is a markup like this

<div class="popup__slider slider ">
   <img src="img/ships/avrora/avatar.jpg" alt="Слайд" class="slider__img">
   <img src="img/ships/avrora/avatar.jpg" alt="Слайд" class="slider__img">
   <img src="img/ships/avrora/avatar.jpg" alt="Слайд" class="slider__img">
                
</div>

And here is such JS
$('.popup__slider').slick({
        arrows: false,
        slidesToShow: 1,
        dots: true

    });

In the end, this is what happens. Wrappers and images have width: 0 set. And if you click on one of the dots, the pictures will appear, but everything will look inadequate.
a7ded97f1b2346d1bb79ab8d7f90c63d.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Shevchenko, 2018-03-21
@WebDev2030

Make sure the slick-list class is set to 100% width

.slick-list {
    width: 100%;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question