微信小程swiper組件實現圖片輪播切換功能
發布時間:2017/12/13 9:59:00 來源: 縱橫數據
本文主要介紹了微信小程使用swiper組件實現圖片輪播切換顯示功能,涉及swiper組件相關屬性使用技巧,希望能幫助到大家。
1、效果展示
2、關鍵代碼
index.wxml:
1 2 3 4 5 6 7 8 9 10 11 | < swiper indicator-dots = "true" autoplay = "true" interval = "3000" duration = "600" style = "height:300px;" > < swiper-item > < image src = "../../pages/images/img1.png" style = "display: block;height: 300px;" /> </ swiper-item > < swiper-item > < image src = "../../pages/images/img2.png" style = "display: block;height: 300px;" /> </ swiper-item > < swiper-item > < image src = "../../pages/images/img3.png" style = "display: block;height: 300px;" /> </ swiper-item > </ swiper > |
swiper組件屬性說明如下:
屬性名 | 類型 | 默認值 | 說明 | 最低版本 |
---|---|---|---|---|
indicator-dots | Boolean | false | 是否顯示面板指示點 | |
indicator-color | Color | rgba(0, 0, 0, .3) | 指示點顏色 | 1.1.0 |
indicator-active-color | Color | #000000 | 當前選中的指示點顏色 | 1.1.0 |
autoplay | Boolean | false | 是否自動切換 | |
current | Number | 0 | 當前所在頁面的 index | |
interval | Number | 5000 | 自動切換時間間隔 | |
duration | Number | 500 | 滑動動畫時長 | |
circular | Boolean | false | 是否采用銜接滑動 | |
vertical | Boolean | false | 滑動方向是否為縱向 | |
bindchange | EventHandle | current 改變時會觸發 change 事件,event.detail = {current: current, source: source} |
縱橫數據成立于2005年,擁有電信IDC/ISP資質,面向全國提供云計算、國際IDC、主機域名、建站營銷、軟件開發、通信工程、機房大帶寬、技術外包等,專業的互聯網服務提供商;一站式云計算解決方案提供商!
聲明:文章來自網絡轉載,若無意中有侵犯您權益的信息,請聯系我們,我們會在第一時間刪除!
本文來源:
//66moju.cn/article/1915.html
[復制鏈接]
鏈接已復制
上一篇:沒有了
下一篇:沒有了