S
S
Sergey Burduzha2019-08-28 16:23:14
JavaScript
Sergey Burduzha, 2019-08-28 16:23:14

How to use two slick.js sliders where one of them is restyled as a thumbnail block?

Good afternoon.
I am developing a project on wordpress.
There is a plugin that turns post thumbnails into 2 sliders connected to each other.
On the top - a large one miniature, on the bottom - several small ones.

Click on the bottom thumbnail and the top slider will scroll to its copy.

I myself can do it in layout.

But here it is completely different.

I destroyed the second slider and turned it into a block with thumbnails.
And now they are not connected.

I came up with the idea of ​​clicking on the thumbnail, counting which number it is, and setting the top slider. $('.your-element').slick('setPosition');

But how to count the element that I clicked on?

Or can you suggest another way.

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2019-08-28
@serii81

$('.первыйслайдер .слайд').on('click', function(){
      var sliderIndex = $(this).index();
      $второйслайдер.slick('slickGoTo', sliderIndex);
    });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question