国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

微信小程序swiper組件用法實例分析【附源碼下載】

2019-11-19 14:46:23
字體:
來源:轉載
供稿:網友

本文實例講述了微信小程序swiper組件用法。分享給大家供大家參考,具體如下:

關于視圖容器swiper的詳細內容可參考官方文檔

先來看看運行效果:

index.js:

Page({ data: {  imgUrls: ['http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg','http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg','http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'  ],  indicatorDots: false,  autoplay: false,  interval: 5000,  duration: 1000 }, changeIndicatorDots: function (e) {  this.setData({   indicatorDots: !this.data.indicatorDots  }) }, changeAutoplay: function (e) {  this.setData({   autoplay: !this.data.autoplay  }) }, intervalChange: function (e) {  this.setData({   interval: e.detail.value  }) }, durationChange: function (e) {  this.setData({   duration: e.detail.value  }) }})

index.wxml:

<swiper indicator-dots="{{indicatorDots}}"autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">  <block wx:for="{{imgUrls}}" wx:key="{{index}}">    <swiper-item>      <image src="{{item}}" class="slide-image" width="355" height="150" ></image>      <text class="textindex">{{index}}</text>    </swiper-item>  </block>  </swiper><button bindtap="changeIndicatorDots"> indicator-dots ({{indicatorDots}})</button><button bindtap="changeAutoplay"> autoplay ({{autoplay}})</button><slider bindchange="intervalChange" show-value min="2000" max="5000"/> interval<slider bindchange="durationChange" show-value min="1000" max="2000"/> duration

index.wxss:

.slide-image{    display: inline;}.textindex{  position: absolute;  top :20px;  color: red;}

附:完整實例代碼點擊此處本站下載

希望本文所述對大家微信小程序開發有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 民县| 噶尔县| 浦县| 合作市| 睢宁县| 孝感市| 喀喇| 越西县| 郁南县| 库伦旗| 昌吉市| 池州市| 万安县| 吴江市| 纳雍县| 珲春市| 田阳县| 孟州市| 河间市| 宜阳县| 雷山县| 潞西市| 青川县| 扶风县| 彭水| 德惠市| 舞阳县| 云霄县| 巫溪县| 龙南县| 嘉定区| 开化县| 乐平市| 新化县| 鄱阳县| 连云港市| 淄博市| 莱阳市| 沙湾县| 永宁县| 天峻县|