D
D
Dextersium2020-05-17 15:34:47
JavaScript
Dextersium, 2020-05-17 15:34:47

How to make div-a class change when switching slide in slick slider?

It is necessary after changing the slide to another one that has the parameters of the currently active one (aria-hidden and tabindex) and the parameter of a specific slide (data-skick-index), the (addClass) class was added in another block of the HTML document. Also, so that it is removed (removeClass) when the data-skick-index changes to another.
5ec12f5e2c9e5928188315.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Chefranov, 2020-05-17
@Dextersium

$('.slider').on('afterChange', function(event, slick, currentSlide, nextSlide){
  $('.anotherClass').addClass('addedClass');
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question