D
D
Deedare2020-12-19 15:11:07
Slick
Deedare, 2020-12-19 15:11:07

How to set up linked slick slider?

Tell me how to make the second slider always show one slide more than the first? That is, the first shows slide 1, the second shows slide 2, not 1. and so on.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-12-19
@Deedare

Instead of using asNavFor, handle slide transition events and toggle the adjacent slider:

const $slider1 = $('.slider-nav').slick({
  ...
}).on('beforeChange', function(e, slick, currSlide, nextSlide) {
  $slider2.slick('slickGoTo', nextSlide + 1);
});

const $slider2 = $('.slider-for').slick({
  ...
}).on('beforeChange', function(e, slick, currSlide, nextSlide) {
  $slider1.slick('slickGoTo', nextSlide - 1);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question