C
C
Concencuc2021-12-11 17:51:08
JavaScript
Concencuc, 2021-12-11 17:51:08

How to disable swipe in slick on button click?

Slick has a swipe: option for this, but it only works on initialization. How can I make an event so that the solution is something like the one below (it does not suit me).

$('button').on('click', () => {
        $('.slider').css('pointer-events', 'none');
  });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JavaDev, 2021-12-11
@Concencuc

const slider = $('.slider').slick({
    // options
});

$('button').on('click', () => {
    slider.slick("slickSetOption", "swipe", false, false);
    //Arguments: option : string, value : depends on option, refresh : boolean
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question