L
L
Lolka212020-04-18 14:16:27
JavaScript
Lolka21, 2020-04-18 14:16:27

Why is the numbering not immediately displayed in the click slider?

Hello, here

is the code:

var num = $('.reviews__sl__num');
var slider = $('.reviews__sl');

slider.on('init reInit afterChange', function(event, slick, currentSlide, nextSlide) {
  var i = (currentSlide ? currentSlide : 0) + 1;
  num.html(i + '<span>из</span>' + slick.slideCount);
});


the question is why the numbering of the slides is not displayed immediately, but only after the change of the slide is displayed, I kind of indicated: init, reInit (run the function after initialization and re-initialization)

I will be grateful for your help ...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question