這篇文章主要介紹小程序在輪播圖里面實現(xiàn)點擊跳轉(zhuǎn)的方法,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
成都創(chuàng)新互聯(lián)公司專注于鶴壁網(wǎng)站建設服務及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗。 熱誠為您提供鶴壁營銷型網(wǎng)站建設,鶴壁網(wǎng)站制作、鶴壁網(wǎng)頁設計、鶴壁網(wǎng)站官網(wǎng)定制、成都小程序開發(fā)服務,打造鶴壁網(wǎng)絡公司原創(chuàng)品牌,更為您提供鶴壁網(wǎng)站排名全網(wǎng)營銷落地服務。
小程序如何在輪播圖里面實現(xiàn)點擊跳轉(zhuǎn)
輪播圖可以使用swiper組件來實現(xiàn),點擊跳轉(zhuǎn)頁面可以使用navigator組件來實現(xiàn),所以實現(xiàn)點擊輪播圖跳轉(zhuǎn)頁面的方法是:在swiper組件的swiper-item組件里嵌套一個navigator即可。
具體實現(xiàn)代碼如下:
1、WXML代碼
<!--輪播圖 --> <view class='swiperBanner'> <swiper indicator-dots='{{indicatorDots}}' autoplay='{{autoplay}}' interval='{{interval}}' duration='{{duration}}' circular='{{circular}}'> <swiper-item wx:for="{{imgUrls}}" wx:key='{{index}}'> <navigator url='{{item.link}}'> <image src="{{item.url}}" class="slide-image" mode="aspectFill"></image> </navigator> </swiper-item> </swiper> </view> </view>
2、WXSS代碼
/* 輪播 */ .swiperBanner{ width:100%; height:420rpx !important; margin:0 auto; } .swiperBanner image{ width:100%; height:420rpx !important; } swiper { width:100%; height:420rpx !important; }
3、JS代碼
indicatorDots:false, autoplay:true, interval:3000, duration: 800, circular:true, // 輪播圖 imgUrls: [ { link:'../activity/washCar1/index/index', url:'https://localhost/static/ttcf/img/banner8.png', }, { link: '../activity/Odysseus/index/index', url: 'https://localhost/static/ttcf/img/banner9.png', }, ],
以上是“小程序在輪播圖里面實現(xiàn)點擊跳轉(zhuǎn)的方法”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關知識,歡迎關注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
名稱欄目:小程序在輪播圖里面實現(xiàn)點擊跳轉(zhuǎn)的方法
鏈接URL:http://chinadenli.net/article2/ppidic.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站、網(wǎng)站策劃、網(wǎng)站營銷、網(wǎng)站制作、手機網(wǎng)站建設、App開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)