微信小程序 swiper組件構建輪播圖的實例
更新時間:2017年09月20日 15:33:29 投稿:lqh
這篇文章主要介紹了微信小程序 swiper組件構建輪播圖的實例的相關資料,如有疑問請留言或者到本站社區(qū)交流討論,需要的朋友可以參考下
微信小程序 swiper組件構建輪播圖的實例
實現(xiàn)效果圖:
wxml基礎文件:
<view class="classname"> <swiper indicator-dots="true" interval="1000" autoplay="true" indicator-active-color="red"> <swiper-item><image src="/images/1.jpg"></image></swiper-item> <swiper-item><image src="/images/2.jpg"></image></swiper-item> <swiper-item><image src="/images/3.jpg"></image></swiper-item> </swiper> </view>
swiper-item僅可放置在組件中,寬高自動設置為100%。 參數(shù)設置: autoplay 自動播放導致swiper變化; touch 用戶劃動引起swiper變化; indicator-dots true是否顯示面板指示點圓圈; interval 自動切換時間間隔; duration 滑動動畫時長; 更多設置可以看官方文檔組件!
wxss樣式文件
swiper{ width:100%; height:500rpx; } swiper image{ width:100%; height:500rpx; }
app.json文件入口
{ "pages": [ "pages/redirect/redirect" ], "window": { "navigationBarBackgroundColor": "#405f80" } }
如有疑問請留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
相關文章
gulp-font-spider實現(xiàn)中文字體包壓縮實踐
這篇文章主要為大家介紹了gulp-font-spider實現(xiàn)中文字體包壓縮實踐詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-03-03JS實現(xiàn)刷新網(wǎng)頁后之前瀏覽位置保持不變示例詳解
這篇文章主要為大家介紹了JS實現(xiàn)刷新網(wǎng)頁后之前瀏覽位置保持不變示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-08-08