S
S
Sergey Burduzha2019-03-07 18:17:42
Slick
Sergey Burduzha, 2019-03-07 18:17:42

Why is the slick slider not disabled at high resolutions?

Here is the js code

//table slider
  $('#js-table').slick({
    responsive: [
      {
        breakpoint: 1920,
        settings: {
          unslick: true
        }
      },
      {
        breakpoint: 660,
        settings: {
          arrows: false,
          dots: true,
        }
      }
    ]
  });

In theory, the slider should turn off at high resolutions, and turn on at a resolution less than 660.
But, this does not happen, it is always on, I do not see an error.
Although, I have another project and everything works there.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WapSter, 2019-03-07
@serii81

I had the same problem, here is the solution that worked for me

$(window).on('load resize', function () {
    var withWindow = window.innerWidth;
      if (withWindow > 660.98) {
          $('#js-table').slick('unslick');
      }
  });

S
Sergey Burduzha, 2019-03-07
@serii81

That's how it works.

//table slider
  $('#js-table').slick({
      dots: true,
      arrows: false,
      responsive: [{
        breakpoint: 1980,
        settings: "unslick" // destroys slick,
      },
      {
        breakpoint: 660,
        settings: {
          dots: true
        },
      }
    ]
  });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question