S
S
servgggg2020-09-03 10:13:50
JavaScript
servgggg, 2020-09-03 10:13:50

How to scroll slick slider two slides?

I ran into a problem that I can’t scroll the slick slider two slides by clicking the button, if the slides are the first, then everything works, if the slide is the last or penultimate, then it doesn’t want to scroll, as if there is no longer a slide with such an index, how to solve the problem?

$('.salon__nextx2').on('click', function () {
  const current = $(".slider.slider_salon").find('.slick-active').attr('data-slick-index');
  $(".slider.slider_salon").slick('slickGoTo', current+1);
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2020-09-03
@iamd503

kenwheeler.github.io/slick Slider Syncing
Example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question