|
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
</div>
</div>
<style type="text/css">
.swiper-container {
width: 600px;
height: 300px;
}
.swiper-slide{
font-size: 50px;
}
.swiper-slide:nth-of-type(1){
background: red;
}
.swiper-slide:nth-of-type(2){
background: yellow;
}
.swiper-slide:nth-of-type(3){
background: blue;
}
</style>
<script>
var mySwiper = new Swiper ('.swiper-container', {
direction: 'horizontal',
loop: true,
})
</script>
当loopd等于true时,slide1背景色为黄色了 而且滑到后面背景为空白,求解
|
|