J
J
Jussss922021-07-04 20:10:31
JavaScript
Jussss92, 2021-07-04 20:10:31

Why doesn't slick slider work below 1200px?

Hello.
Tell me what could be the problem?
texenergo21.pr-ff.ru on my site, if you click on the menu below, then the
60e1eb364c6e0830398937.jpeg
slider allegedly works (is initialized), but the styles are crooked.
Although if you open the window and start moving, then from 1200 styles everything works fine and there are no problems.
What could be the problem?
My code is the usual one for launching the slider

$('.absolute-cart-slider-2').slick({
    arrows: true,
    dots: false,
    slidesToShow: 5,
    slidesToScroll: 1,
    prevArrow: $('.absolute-prev'),
    nextArrow: $('.absolute-next'),
    responsive: [{
      breakpoint: 1200,
      settings: {
        slidesToShow: 4,
        slidesToScroll: 1
      }
    },
    {
      breakpoint: 998,
      settings: {
        slidesToShow: 3,
        slidesToScroll: 1
      }
    },
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 1
      }
    },


  ]
  })

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Jussss92, 2021-07-05
@Jussss92

I solved the problem by setting infinite false. That helped

K
kryamk, 2021-07-04
@kryamk

No need to prescribe bootstrap col-3 styles for slides, the slider will distribute the width itself. And the distance between slides

.slick-slide {
   margin: 0 30px;
}
.slick-list {
   margin: 0 -30px;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question