微信小程序swiper组件用法实例分析【附源码下载】

本文实例讲述了微信小程序swiper组件用法分享给大家供大家参考,具体如下:

关于视图容器swiper的详细内容可参考官方文档

先来看看运行效果

index.js:

rush:js;"> Page({ data: { imgurls: ['http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg','http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg','http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg' ],indicatorDots: false,autoplay: false,interval: 5000,duration: 1000 },changeIndicatorDots: function (e) { this.setData({ indicatorDots: !this.data.indicatorDots }) },changeAutoplay: function (e) { this.setData({ autoplay: !this.data.autoplay }) },intervalChange: function (e) { this.setData({ interval: e.detail.value }) },durationChange: function (e) { this.setData({ duration: e.detail.value }) } })

index.wxml:

rush:xml;"> utoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> imgurls}}" wx:key="{{index}}">

index.wxss:

rush:css;"> .slide-image{ display: inline; } .textindex{ position: absolute; top :20px; color: red; }

附:

完整实例代码点击此处本站下载

希望本文所述对大家微信小程序开发有所帮助。

相关文章

开发微信小程序的用户授权登录功能
小程序开发页面如何实现跳转?
浅谈小程序开发中蓝牙连接错误分析及解决方法
什么是小程序?它有哪些功能?
如何配置小程序开发项目结构?(教程)
怎么把自己的店加入小程序