Im trying to receive an index of the currently active slide, and that
s work as expected, but in the console I can see that last page index same as one`s before last.
I tried this (inside init function)
let pageSlider = new Swiper('.page', {
// initialise make my own classes as standart sliders classes
wrapperClass: "page_wrapper",
slideClass: "page_screen",
// events
on: {
init: function () {
menuSlider();
setScrollType();
wrapper.classList.add('_loaded');
let text = document.getElementById('opacity_change').getElementsByClassName('screen_title');
for (let index = 0; index < text.length; index++) {
text[index].classList.add('_loaded');
}
},
slideChange: function () {
menuSliderRemove();
menuLinks[pageSlider.realIndex].classList.add('_active');
let active = this.activeIndex; // LOOK HERE
console.log(active); // LOOK HERE
},
resize: function () {
setScrollType();
}
}
});
and that (outside init function)
pageSlider.on('transitionEnd', function () {
console.log('*** pageSlider.realIndex', pageSlider.realIndex);
});
and got the same result
If you look on the screenshot, I`ve set up pagination bullets, so we can see that I have 5 slides, but switching between fourth and fifth return same index - 3. Somebody know possible reasons?
Thanks in advance!