国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

微信小程序使用swiper組件實現層疊輪播圖

來源:懂視網 責編:小OO 時間:2020-11-27 22:05:33
文檔

微信小程序使用swiper組件實現層疊輪播圖

本文實例為大家分享了微信小程序實現層疊輪播圖的具體代碼,供大家參考,具體內容如下:wxml。<;view class="banner-swiper">;<;<;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>;<。
推薦度:
導讀本文實例為大家分享了微信小程序實現層疊輪播圖的具體代碼,供大家參考,具體內容如下:wxml。<;view class="banner-swiper">;<;<;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>;<。

本文實例為大家分享了微信小程序實現層疊輪播圖的具體代碼,供大家參考,具體內容如下

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> 

wxss:

.banner-swiper {
 width: 100%;
 height: 500rpx;
 overflow: hidden;
}

swiper {
 display: block;
 height: 500rpx;
 position: relative;
}

.slide-image {
 width: 96%;
 display: block;
 margin: 0 auto;
 height: 450rpx;
 margin-top:25rpx;
}
.active{
 margin-top:0rpx;
 height: 500rpx;
}

js:

Page({
 data: {
 //輪播圖
 swiperCurrent:1,
 arr: [{
 images: 'images/1.jpg'
 },
 {
 images: 'images/5.jpg'
 },
 {
 images: 'images/3.jpg'
 },
 {
 images: 'images/4.jpg'
 }
 ]
 indicatorDots: true,
 autoplay: true,
 interval: 2000,
 duration: 1000,
 circular: true,
 beforeColor: "white",//指示點顏色 
 afterColor: "coral",//當前選中的指示點顏色 
 previousmargin:'30px',//前邊距
 nextmargin:'30px',//后邊距
 
 },
 
 //輪播圖的切換事件 
 swiperChange: function (e) {
 console.log(e.detail.current);
 this.setData({
 swiperCurrent: e.detail.current //獲取當前輪播圖片的下標
 })
 },
 //滑動圖片切換 
 chuangEvent: function (e) { 
 this.setData({
 swiperCurrent: e.currentTarget.id
 })
 },
})


效果圖:

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

微信小程序使用swiper組件實現層疊輪播圖

本文實例為大家分享了微信小程序實現層疊輪播圖的具體代碼,供大家參考,具體內容如下:wxml。<;view class="banner-swiper">;<;<;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>;<。
推薦度:
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 欧美激情免费观看一区 | 久久久久久久99久久久毒国产 | 操碰97| 亚洲国产成人精品91久久久 | 欧美日韩资源 | 五月激情丁香 | 久久精品无遮挡一级毛片 | 欧美 日韩 中文字幕 | 国产在线精品一区二区三区不卡 | 日韩不卡一区二区 | 伊人久久国产 | 免费国产黄网站在线观看视频 | 精品一区二区三区视频日产 | 在线观看国产视频 | 国产精品路线1路线2路线 | 国产亚洲欧美一区 | 国产在线精品观看 | 国产片欧美片亚洲片久久综合 | 精品欧美一区二区在线观看 | 亚洲综合精品一区二区三区中文 | 精品国产一区二区在线观看 | 国产欧美久久久精品影院 | 日韩va亚洲va欧美va浪潮 | 精品国产综合成人亚洲区 | 黄色一级视频免费观看 | 全免费a级毛片免费毛视频 情侣国产在线 | 国产一级淫片a免费播放口 国产一级特黄a大片99 | 日韩欧美一区二区三区四区 | 日本黄a | 国产精品免费看 | 欧美日韩一二区 | 国产精品v一区二区三区 | 国产啪视频 | 欧美日韩亚洲一区二区三区 | 一区免费在线观看 | 亚洲美女一区二区三区 | 日韩高清欧美 | 自拍 欧美 在线 综合 另类 | 亚洲高清一区二区三区 | 国产一区二区在线看 | 美女视频黄a视频免费全过程在线 |