K
K
Konstantin2016-12-05 11:07:05
JavaScript
Konstantin, 2016-12-05 11:07:05

How to use current slide index in Slick Slider?

Can you please tell me which function can get the value of the current slide? What would, subject to the presence of a certain index, add a class to a certain element

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Антон Сашнин, 2016-12-05
@VinnieBrigston

https://github.com/kenwheeler/slick#events

$('.your-element').on('beforeChange', function(event, slick, currentSlide, nextSlide){
  console.log(currentSlide); // индекс текущего слайда
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question