Jump to content

SergeyMsky

Neophyte
  • Posts

    1
  • Joined

  • Last visited

Everything posted by SergeyMsky

  1. Есть js в котором работает счетчик слайда. При свайпе, следующему слайду, добавляется новый текст. Вопрос: как изменить опять текст, при свайпе назад <span class="name-itm">Текст</span> var $slider = $('.slider'); var sliderCounter = document.getElementsByClassName("slider-counter"); var nameItm = document.getElementsByClassName("name-itm"); var newText = "Новый текст"; if ($slider.length) { var updateSliderCounter = function(slick, currentIndex) { currentSlide = slick.slickCurrentSlide() + 1; $(sliderCounter).text(currentSlide); }; $slider.on('afterChange', function(event, slick, currentSlide, nextSlide) { updateSliderCounter(slick, currentSlide, nextSlide); nextSlide = newText; $(nameItm).text(nextSlide); }); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy