宝哥软件园

微信小程序使用捣蛋鬼组件实现层叠轮播图

编辑:宝哥软件园 来源:互联网 时间:2021-08-29

本文实例为大家分享了微信小程序实现层叠轮播图的具体代码,供大家参考,具体内容如下

wxml:

view class=' banner-swiper ' swiper indicator-dots=' { { indicatorDots } } ' autoplay=' { { autoplay } } ' current=' { { swiperCurrent } } ' indicator-color=' { { before color } } ' indicator-active-color=' { { after color } } ' circular=' { { circular } } ' previous-margin=' { { next margin } } bind change=' swipurge '块wx 3:对于=' { { margin activity ' : ' ' } ' bind change='创事件id=' { { index } } '/image/swiper-item/block/swiper/view wxss 3360。横幅-swiper { width : 100%;高度: 500 rpx飞越:隐藏;} swiper { display:块高度: 500 rpx相对位置:}.幻灯片图像{宽度: 96%;显示器:块;margin: 0自动高度: 450 rpx页边距-top :25 rpx;}.活动{利润率-最高:0 rpx高度: 500 rpx}js:

页面({ data: { //轮播图swiperCurrent:1,arr :[{ images : ' images/1。jpg ' },{ images: 'images/5.jpg' },{ images: 'images/3.jpg' },{ images 3360 ' images/4。jpg ' }]指示器ots 3360为真,autoplay:为真,interval: 2000,duration: 1000,circular:指示点颜色afterColor: 'coral ',//当前选中的指示点颜色previousmargin:'30px ',//前边距nextmargin:'30px ',//后边距}, //轮播图的切换事件瑞士:函数{控制台。日志(例如详细信息。电流);这个。setdata({ swipercurrent : e . detail。当前/获取当前轮播图片的下标}) }, //滑动图片切换创事件:函数{这个。setdata({ swipercurrent : e . current target。id })},})效果图:

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持我们。

更多资讯
游戏推荐
更多+