刚开始并没有接触到层叠轮播图,拿到这个案列的时候特意查阅了一下资料,发现previousmargin和nextmargin可以试下层叠效果,就尝试着用了一下。
微信小程序XX.wxml下
<view class="banner-swiper">
<swiper indicator-dots="{
{indicatorDots}}" autoplay="{
{autoplay}}" current='{
{swiperCurrent}}'
indicator-color="{
{beforeColor}}" indicator-active-color="{
{afterColor}}" circular='{
{circular}}'
previous-margin="{
{previousmargin}}" next-margin="{
{nextmargin}}" bindchange="swiperChange" >
<block wx:for="{
{arr}}" wx:key="key">
<swiper-item>
<image src="{
{item.images}}" class="slide-image{
{index == swiperCurrent ? ' active' : ''}}"
bindchange="chuangEvent" id="{
{index}}"></image>
</swiper-item>
</block>
</swiper>
</view>
微信小程序XX.wxss下
.b