H
H
heavig22020-11-15 01:35:00
JavaScript
heavig2, 2020-11-15 01:35:00

Breakpoint in slick-slider works every other time?

Hello. There are 2 video blocks on the page. The following code is used to initialize slick:

$('.videos__list').each(function() {
  if ( $(this).hasClass("videos__list__nocarousel")){} else {
    if ( $(this).find('.videos_page').length > 3) {
      $(this).slick({
          slidesToShow: 4,
          dots: false,
          arrows: true,
          nextArrow: '<div class="video_right"><img src="/assets/images/cart-right.png"></div>',
          prevArrow: '<div class="video_left"><img src="/assets/images/cart-left.png"></div>',
          infinite: false,
          responsive: [
            {
              breakpoint: 915,
              settings: {
                slidesToShow: 3
              }
            }
          ]
      });
    }
  }
});

And so, breakpoint works only in the last block - changed their places, works all the same on the last. Can you suggest what is the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question