0

Есть вот такой пример https://jsfiddle.net/rLLvvpcm/5/ Там вместо обычных dots, идут числа. Как начать исчисление с 1, а не с нуля ?

<section class="slider">
   <div>slide1</div>
   <div>slide2</div>
   <div>slide3</div>
   <div>slide4</div>
   <div>slide5</div>
   <div>slide6</div>
</section>

<span class="pagingInfo"></span>

 $(".slider").slick({
 autoplay: true,
 dots: true,
 customPaging : function(slider, i) {
 var thumb = $(slider.$slides[i]).data();
  return '<a>1</a>';
 },
responsive: [{ 
    breakpoint: 500,
    settings: {
    dots: false,
    arrows: false,
    infinite: false,
    slidesToShow: 2,
    slidesToScroll: 2
} 
 }]
});

1 ответ 1

2

Вот в этой строчке измените i на i+1: return ''+(i+1)+'';

1
  • супер, спасибо. очень выручили 9 янв 2018 в 13:57

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.