小程序swiper叠加效果
文章描述:
小程序使用swiper制作叠加效果
wxml
<!--banner-->
<view class="banner">
<swiper class="swiper swiper-wrap" indicator-dots="true" autoplay="true" interval="4000" circular previous-margin="20" next-margin="20">
<block>
<swiper-item><image src="/images/banner1.jpg" mode="widthFix"></image></swiper-item>
<swiper-item><image src="/images/banner2.jpg" mode="widthFix"></image></swiper-item>
<swiper-item><image src="/images/banner1.jpg" mode="widthFix"></image></swiper-item>
<swiper-item><image src="/images/banner2.jpg" mode="widthFix"></image></swiper-item>
</block>
</swiper>
</view>
wxss
/* banner */
.banner{ width: 100%; height: 500rpx;position: relative; }
.banner .swiper{ width: 100%; height: 100%; }
.banner .swiper image{ width: 100%; }
.bannerItem{ padding: 0;}
发布时间:2021/06/08
发表评论