<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題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關(guān)鍵字專題關(guān)鍵字專題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組件實現(xiàn)層疊輪播圖

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

        微信小程序使用swiper組件實現(xiàn)層疊輪播圖

        本文實例為大家分享了微信小程序?qū)崿F(xiàn)層疊輪播圖的具體代碼,供大家參考,具體內(nèi)容如下: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>;<。
        推薦度:
        導(dǎo)讀本文實例為大家分享了微信小程序?qū)崿F(xiàn)層疊輪播圖的具體代碼,供大家參考,具體內(nèi)容如下: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>;<。

        本文實例為大家分享了微信小程序?qū)崿F(xiàn)層疊輪播圖的具體代碼,供大家參考,具體內(nèi)容如下

        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
         })
         },
        })
        
        
        

        效果圖:

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

        文檔

        微信小程序使用swiper組件實現(xiàn)層疊輪播圖

        本文實例為大家分享了微信小程序?qū)崿F(xiàn)層疊輪播圖的具體代碼,供大家參考,具體內(nèi)容如下: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
        主站蜘蛛池模板: 亚洲一线产区二线产区精华| 无码乱人伦一区二区亚洲| 亚洲综合一区无码精品| 四虎免费影院ww4164h| 亚洲最新在线视频| 国产成人精品久久免费动漫| 亚洲午夜精品在线| 大地资源免费更新在线播放| 亚洲人成色99999在线观看| 日本免费一区尤物| 免费看一级一级人妻片 | 美女视频黄.免费网址| 免费看一级做a爰片久久| 香蕉视频免费在线| 久久亚洲色一区二区三区| 最好免费观看高清在线| 亚洲综合一区二区国产精品| 国产成人精品免费视频大| 亚洲中文字幕AV每天更新| 国产高清免费观看| A毛片毛片看免费| 久久久久久久亚洲Av无码 | 日本红怡院亚洲红怡院最新| 青青草无码免费一二三区| 亚洲一区动漫卡通在线播放| 日韩精品视频免费在线观看| 曰韩无码AV片免费播放不卡| 亚洲国产天堂在线观看| 成全高清视频免费观看| 人与动性xxxxx免费| 久久精品亚洲精品国产色婷| 精品免费国产一区二区| 成在人线av无码免费高潮水| 亚洲国产精品午夜电影| 国产aa免费视频| 亚洲电影免费在线观看| 亚洲欧美日韩中文高清www777| 亚洲精品无码av人在线观看| 黄页网站免费观看| 精品无码一级毛片免费视频观看| 亚洲色图综合网站|