TA的每日心情 | 郁闷 2019-4-17 13:42 |
---|
签到天数: 14 天 [LV.3]偶尔看看II
注册会员

- 积分
- 167
|
<div class="adswiper">
<swiper ptions="swiperOption" v-if="banner_list.length > 0">
<swiper-slide v-for="(item, index) in banner_list" :key="index">
<router-link :to="{ name:'detail', params: { id: item.building.id }}">
<a><img class="lt" :src="item.image" /></a>
</router-link>
</swiper-slide>
</swiper>
</div>
css
.adswiper {
width: 100%;
height: auto;
overflow: hidden;
}
.adswiper .swiper-slide {
width: 93%;
height:200px;
border-radius: 5px;
}
.adswiper img {
display: block;
margin: 0 auto;
margin-top: 3.5%;
width: 98%;
border-radius: 5px;
height: 90.625%;
border-radius: 5px;
vertical-align: middle;
}
.swiper-slide-active img {
margin-top: 0;
width: 100%;
height: 100%;
border-radius: 5px;
/* -moz-box-shadow:0px 0px 10px #A1A1A1; -webkit-box-shadow:0px 0px 10px #A1A1A1; box-shadow:0px 0px 10px #A1A1A1;*/
}
Js
swiperOption: {
loop: true,
initialSlide: 1,
watchSlidesProgress: true,
slidesPerView: 'auto',
autoplay: {
delay: 3000,
stopOnLastSlide: false,
disableOnInteraction: false,
},
autoplayDisableOnInteraction: true,
slidesPerView: "auto", //设置slider容器能够同时显示的slides数量(carousel模式)。可以设置为数字(可为小数,小数不可loop),或者 'auto'则自动根据slides的宽度来设定数量。loop模式下如果设置为'auto'还需要设置另外一个参数loopedSlides。
centeredSlides: true //<span style="color:rgb(68,68,68);font-family:'microsoft yahei';font-size:13px;">设定为true时,活动块会居中,而不是默认状态下的居左。</span>
},
|
|