Skip to content
Discussion options

You must be logged in to vote

I went through the Swiper code and noticed the for loop inside the if (params.normalizeSlideIndex) { } in the slideTo function is in this case incorrectly recalculating the slideIndex, causing the "swiper-slide-active" class to be added to the wrong slide.

Adding normalizeSlideIndex: false to the parameters of the Swiper appears to fix the problem.
It's not clear from the documentation what this parameter is supposed to do, so this might have other side effects I haven't noticed yet.

Hopefully this will be of use to others.

Fiddle with the fix: https://jsfiddle.net/wxo9ugkz/

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@myrecs
Comment options

Answer selected by Stanzi1791
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5074 on October 09, 2021 18:23.