最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

微信小程序 swiper組件詳解及實(shí)例代碼

 更新時(shí)間:2016年10月25日 09:39:59   投稿:lqh  
這篇文章主要介紹了微信小程序 swiper組件詳解及實(shí)例代碼的相關(guān)資料,需要的朋友可以參考下

微信小程序 swiper組件

常用屬性:

效果圖:

 swiper.wxml添加代碼:

<swiper indicator-dots="{{indicatorDots}}"
 autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}} " bindchange="bindchangeTag">
 <block wx:for="{{imgUrls}}">
  <swiper-item>
   <image src="{{item}}" class="slide-image"/>
  </swiper-item>
 </block>
</swiper>
<button bindtap="changeIndicatorDots"> 是否顯示面板指示點(diǎn) </button>
<button bindtap="changeAutoplay"> 是否自動(dòng)切換 </button>
<slider bindchange="intervalChange" show-value min="1000" max="2000"/> 自動(dòng)切換時(shí)間間隔
<slider bindchange="durationChange" show-value min="1800" max="10000"/> 滑動(dòng)動(dòng)畫(huà)時(shí)長(zhǎng)

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: 1000,
  duration: 1800
 },
 //是否顯示面板指示點(diǎn)
 changeIndicatorDots: function(e) {
  this.setData({
   indicatorDots: !this.data.indicatorDots
  })
 },
 //是否自動(dòng)切換
 changeAutoplay: function(e) {
  this.setData({
   autoplay: !this.data.autoplay
  })
 },
 //自動(dòng)切換時(shí)間間隔
 intervalChange: function(e) {
  this.setData({
   // e.detail.value獲取slider的值
   interval: e.detail.value
  })
 },
 //滑動(dòng)動(dòng)畫(huà)時(shí)長(zhǎng)
 durationChange: function(e) {
  this.setData({
   duration: e.detail.value
  })
 },
 //當(dāng)頁(yè)面改變是會(huì)觸發(fā)
 bindchangeTag:function(e){
  console.log("bindchangeTag...")
 }, 
 onLoad:function(options){
  // 頁(yè)面初始化 options為頁(yè)面跳轉(zhuǎn)所帶來(lái)的參數(shù)
 },
 onReady:function(){
  // 頁(yè)面渲染完成
 },
 onShow:function(){
  // 頁(yè)面顯示
 },
 onHide:function(){
  // 頁(yè)面隱藏
 },
 onUnload:function(){
  // 頁(yè)面關(guān)閉
 }
})

css:

.slide-image{
  width: 100%;
  height: 160px;
}

 感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論

泸西县| 龙陵县| 玉门市| 额济纳旗| 通化县| 阿荣旗| 宜章县| 桦甸市| 正宁县| 东丰县| 恩平市| 宜宾市| 黄大仙区| 日喀则市| 诏安县| 措勤县| 神池县| 宣化县| 寻乌县| 富源县| 仲巴县| 武定县| 六枝特区| 手游| 大安市| 武平县| 莱州市| 桓台县| 绥阳县| 县级市| 民县| 南康市| 沙洋县| 江门市| 凤台县| 中阳县| 外汇| 西和县| 化州市| 和林格尔县| 元氏县|