D
D
damarkuzz2020-10-27 12:01:33
JavaScript
damarkuzz, 2020-10-27 12:01:33

How to make the slider into normal blocks when the button is clicked?

How to deactivate Slick Slider slider on button click?
There is a command that allows you to "destroy" the settings: "unslick" slider with a certain media query, but to be honest, I don't understand how to apply it to the click event. Tried this code, doesn't work:

$(".all-cats-btn").click(function(e) {
    e.preventDefault();
    $('.catalog-main').slick({
        settings: "unslick",
  });
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Litvinenko, 2020-10-27
@damarkuzz

$('.all-cats-btn').on('click', function(e) {
  e.preventDefault();
  $('.catalog-main').slick('unslick');
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question