Swiper: autoplay is does not working (React)

Created on 27 Nov 2020  路  1Comment  路  Source: nolimits4web/swiper

This is a (multiple allowed):

  • [x] bug
  • [ ] enhancement
  • [ ] feature-discussion (RFC)
  • Swiper Version: ^6.3.5.
  • Platform/Target and Browser Versions: chrome h5 with macos ,android, ios.
  • Live Link or JSFiddle/Codepen or website with isssue:

import { Swiper, SwiperSlide } from 'swiper/react';
import SwiperCore, { EffectCoverflow } from 'swiper';
import 'swiper/swiper.less';
import 'swiper/components/effect-coverflow/effect-coverflow.less';

SwiperCore.use([EffectCoverflow]);
slidesPerView={1}
centeredSlides={true}
spaceBetween="3%"
slidesPerView="auto"
loop={true}
autoplay={{
delay: 2000,
disableOnInteraction: false,
}}
effect="coverflow"
coverflowEffect={{
rotate: 0,
stretch: 0,
depth: 360,
modifier: 1,
slideShadows: false,
}}
>
< SwiperSlide > 1< /SwiperSlide >
< SwiperSlide > 2< /SwiperSlide >
< SwiperSlide > 3< /SwiperSlide >

What you did

i set autoplay options but autoplay is does not working;

Expected Behavior

autoplay can normal working

Actual Behavior

i set autoplay options but autoplay is does not working;

Most helpful comment

You should import and install the Autoplay component.

import SwiperCore, { Autoplay } from 'swiper'

SwiperCore.use([Autoplay])

Then the autoplay is working.

>All comments

You should import and install the Autoplay component.

import SwiperCore, { Autoplay } from 'swiper'

SwiperCore.use([Autoplay])

Then the autoplay is working.

Was this page helpful?
0 / 5 - 0 ratings