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

首頁 > 編程 > JavaScript > 正文

微信小程序 圖片寬度自適應的實現

2019-11-19 16:54:28
字體:
來源:轉載
供稿:網友

 微信小程序 圖片寬度自適應的實現

實例代碼:

wxml 代碼:

<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">   <block wx:for="{{imgUrls}}" wx:key="image">    <swiper-item>      <image src="{{item.image}}" model="aspectFit" style="width: {{imageWidth}}px;" bindload="imageLoad" />    </swiper-item>   </block> </swiper>  

  JS 代碼:

imageLoad: function () {   this.setData({    imageWidth: wx.getSystemInfoSync().windowWidth,//圖片寬度     imgUrls: [      { image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" },    { image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" },    { image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" }],    indicatorDots: false,//是否顯示圓點   autoplay: true,//自動播放   interval: 2000,//間隔時間   duration: 1000//監聽滾動和點擊事件  }) } 

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 道真| 侯马市| 锦州市| 永新县| 韶山市| 印江| 衡南县| 贺州市| 闽清县| 合水县| 朝阳县| 大埔县| 阳泉市| 吉木乃县| 商河县| 旬邑县| 怀仁县| 徐水县| 荥阳市| 体育| 建水县| 梧州市| 古田县| 通辽市| 延吉市| 西乌| 云阳县| 五台县| 日照市| 武功县| 略阳县| 喀喇| 镇康县| 晋江市| 建始县| 年辖:市辖区| SHOW| 南召县| 新巴尔虎左旗| 武宁县| 石首市|