Is there a way to prevent slideTo in loop mode initialization? #7677
Unanswered
allenOrangeXu
asked this question in
Q&A
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.
-
Hello:
I'm working on Swiper React component in loop mode, and I want to add some transition effect when scrolling, my thought is that I can add some CSS like this:
but I found that swiper also calls slideTo(xxx) during init(), which will introduce an extra transition when first load. Which I'd like to prevent.
I then think about adding an extra class to each element after initialization to allow transition, and I try something like
, yet then it set swiper.slides to empty array. Also, the update function seems to call slideTo() as well.
I wonder if there's any elegant way to address this? I just want to avoid any transition/animation upon Swiper initialization. Thanks ahead!
Beta Was this translation helpful? Give feedback.
All reactions