swiper 版本4.0
new Swiper('.swiper-container', {
direction: 'vertical',
effect: 'coverflow',
slidesPerView: 3,
// centeredSlides: true,
autoplay: {
delay: 5000, //3秒切换一次
disableOnInteraction: false
},
grabCursor: true,
loop: true,
coverflowEffect: { //重点
rotate: 0,
stretch: -50,
depth: 400,
modifier: 1,
shadows: true
}
});
<div className="swiper-container wh">
<div className="swiper-wrapper">
<div className="swiper-slide">
<img className="w" src={time} alt="" />
</div>
<div className="swiper-slide">
<img className="w" src={time} alt="" />
</div>
<div className="swiper-slide">
<img className="w" src={time} alt="" />
</div>
<div className="swiper-slide">
<img className="w" src={time} alt="" />
</div>
</div>
</div>