|
本来是一个页面显示两个图标,让它自动轮播,然而页面加载完的时候,它的确滑动了,不过就像是卡住了,它不是一整个滑块在滑动,而是往前卡一下,又退回来。附上部分代码:
<div class="swiper-container swiper-container2">
<div class="swiper-wrapper">
<div class="swiper-slide" style="text-align: center;">
<img src="images/college_banner1.png" alt="" style="width: 5.22rem;height: 2.56rem;"/>
</div>
<div class="swiper-slide" style="text-align: center;">
<img src="images/college_banner2.png" alt="" style="width: 5.22rem;height: 2.56rem;"/>
</div>
<div class="swiper-slide" style="text-align: center;">
<img src="images/college_banner3.png" alt="" style="width: 5.22rem;height: 2.56rem;"/>
</div>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev swiper-button-white"></div>
<div class="swiper-button-next swiper-button-white"></div>
</div>
<script>
var swiper2 = new Swiper ('.swiper-container2', {
autoplay:1000,
grabCursor: true,
centeredSlides: true,
slidesPerView: 'auto',
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev'
})
</script>
(我这个是页面中第二个banner图,不过我觉得这跟第几个banner没有关系)
有没有大神指点一下,为什么啊?
|
|