swiper.slideTo(5) Jumps to Penultimate Image Instead of Last Image #7573
mircobalda
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am experiencing an issue with the Swiper library when trying to programmatically slide to the last image in a swiper. Specifically, when I use the method swiper.slideTo(5) to slide to the last image in a set of 5 images, the swiper jumps to the penultimate image instead of the last one.
Steps to Reproduce:
Go to this URL.
Open the developer console in Chrome (F12 or right-click and select "Inspect", then go to the "Console" tab).
Execute the following command in the console:
javascript
swiper.slideTo(5);
Expected Behavior:
The swiper should slide to the 5th image (the last image).
Actual Behavior:
The swiper slides to the 4th image (the penultimate image).
I would appreciate any guidance or solutions for this issue. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions