V
V
Vasily Khryagin2020-09-27 13:53:09
JavaScript
Vasily Khryagin, 2020-09-27 13:53:09

How to make such numbers in slick-slider?

5f706f0c1ccdd559131103.jpeg
help me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Litvinenko, 2020-09-27
@podkudahka

Well, with numbers

var $pagingInfo = $('.paging-info');
var $heroSlider = $('.hero-slider');

$heroSlider.on('init reInit afterChange', function(event, slick, currentSlide, nextSlide){
  var i = (currentSlide ? currentSlide : 0) + 1;
  var prefix = i < 10 ? '0' : '';
  var prefixAll = slick.slideCount < 10 ? '0' : '';
  $pagingInfo.html('<span class="current">' + prefix + i + '</span>' + '/' + prefixAll + slick.slideCount);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question