OnChange

Slider with onChange option. To see the effect, check the console. Go Back
1
2
3
4

Code

const slider = new SimpleSlider('.selector', { onChange: function() { const activeIndex = slider.updateIndex(slider.index); const activeSlide = slider.slides[activeIndex]; console.log('Active Slide: ', activeSlide); } });