P
P
Pit2020-01-27 14:39:39
JavaScript
Pit, 2020-01-27 14:39:39

How to add span tag in slick slider in dots > button elements, and so that number is written in this tag?

There is the usual list of slick-dots, I need the span tag to be added to the button tags and there is a number inside the span. How can this be implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alams Stoyne, 2020-01-27
@pit6262

You can use the option (method) customPaging.

$('.slider').slick({
  arrows: false,
  dots: true,
  dotsClass: 'slick-dots slider__dots',
  customPaging: function(slick, index) {
    return '<span>' + index+ '</span> '
  }
})

In general, it seems to me easier to style the button

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question