Skip to content

How do I set autoplay options when using the Element web component in React? #6436

Answered by Koreanderson
mattbarnicle asked this question in Q&A
Discussion options

You must be logged in to vote

@mattbarnicle

You can pass Swiper object params in the [key]-[subkey] format.

https://swiperjs.com/element#parameters-as-attributes

So to match your previous autoplay settings you could update your swiper-container element like so:

<swiper-container
    effect="slide"
    navigation="false"
    pagination="false"
    autoplay-delay="5000"
    autoplay-disable-on-interaction="false"
    autoplay-reverse-direction="true"
    space-between="30"
    loop="true"
    allow-touch-move="false"
    prevent-clicks="false"
  >
...
</swiper-container>

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@alexmattingley
Comment options

@mattbarnicle
Comment options

@mora260
Comment options

@grand-rick
Comment options

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