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

微信小程序輪播圖自定義光標(biāo)位置

 更新時(shí)間:2022年06月24日 11:39:47   作者:示羊online  
這篇文章主要為大家詳細(xì)介紹了微信小程序輪播圖自定義光標(biāo)位置,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了微信小程序輪播圖自定義光標(biāo)位置的具體代碼,供大家參考,具體內(nèi)容如下

如圖

輪播圖的光標(biāo)可以用定位來(lái)改變上下左右的位置

wxml:

<!--start banner ? -->
<swiper class='home-swiper' autoplay='true' bindchange='changDot' interval='4000'>
? <!-- 設(shè)置自動(dòng)播放,切換間隔時(shí)間-->
? <swiper-item wx:for="{{slider}}" wx:for-index="index" wx:key="slider">
? ? <image src='{{item.img}}'></image>
? </swiper-item>
</swiper>
<!-- 輪播圖光標(biāo) -->
<view class="dots">
? <block wx:for="{{slider}}" wx:key="slider">
? ? <view class="dot {{index == swiperCurrent?'actives':''}}"></view>
? </block>
</view>
<!-- end banner -->

wxss:

/* 輪播圖圖片尺寸 */
?
.home-swiper {
? width: 100%;
? height: 350rpx;
? position: relative;
}
?
.home-swiper image {
? width: 100%;
? height: 100%;
}
?
/* 輪播圖指示點(diǎn) */
?
.dots {
? display: flex;
? flex-direction: row;
? position: absolute;
? top: 311rpx;
? width: 100%;
? height: 50rpx;
? justify-content: center;
}
?
.dots .dot {
? width: 20rpx;
? height: 20rpx;
? /* background-color: #333; */
? /* border: 1rpx solid #e8672e; */
? margin-left: 12rpx;
? background: #fff;
? border-radius: 20rpx;
? /* transform: all 0.6; */
? opacity: 0.44;
}
?
/* 調(diào)用的css效果 */
?
.dots .actives {
? background-color: #fff;
? opacity: 1;
}

js:

Page({
?
? /**
? ?* 頁(yè)面的初始數(shù)據(jù)
? ?*/
? data: {
? ? swiperCurrent: 0,
? ? slider :[
? ? ? {'img':'/img/img/1.jpg'},
? ? ? { 'img': '/img/img/1.jpg' },
? ? ? { 'img': '/img/img/1.jpg' },
? ? ? { 'img': '/img/img/1.jpg' },
? ? ? { 'img': '/img/img/1.jpg' }
? ? ]
? },
? // 輪播圖下標(biāo)
? changDot(e) {
? ? this.setData({
? ? ? swiperCurrent: e.detail.current
? ? });
? },
? /**
? ?* 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面加載
? ?*/
? onLoad: function(options) {
?
? },
?
? /**
? ?* 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面初次渲染完成
? ?*/
? onReady: function() {
?
? },
?
? /**
? ?* 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面顯示
? ?*/
? onShow: function() {
?
? },
?
? /**
? ?* 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面隱藏
? ?*/
? onHide: function() {
?
? },
?
? /**
? ?* 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面卸載
? ?*/
? onUnload: function() {
?
? },
?
? /**
? ?* 頁(yè)面相關(guān)事件處理函數(shù)--監(jiān)聽(tīng)用戶下拉動(dòng)作
? ?*/
? onPullDownRefresh: function() {
?
? },
?
? /**
? ?* 頁(yè)面上拉觸底事件的處理函數(shù)
? ?*/
? onReachBottom: function() {
?
? },
?
? /**
? ?* 用戶點(diǎn)擊右上角分享
? ?*/
? onShareAppMessage: function() {
?
? }
})

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

班玛县| 原阳县| 青海省| 新蔡县| 夏河县| 康定县| 德昌县| 韶关市| 东海县| 津南区| 广安市| 治县。| 鄱阳县| 万荣县| 浦县| 大庆市| 青铜峡市| 甘洛县| 东乌珠穆沁旗| 思南县| 庆云县| 德令哈市| 怀化市| 安国市| 衡山县| 合作市| 永吉县| 滕州市| 雷波县| 迭部县| 崇文区| 太仓市| 辉县市| 确山县| 翁源县| 德格县| 蒲江县| 新竹县| 屏东市| 永靖县| 简阳市|