从零开始开发微信小程序轮播图(五)

互联网 18-3-21
Swiper是滑动特效插件,面向手机、平板电脑等移动终端。能实现触屏焦点图、触屏Tab切换、触屏多图切换等常用效果。是目前应用较广泛的移动端网页触摸内容滑动插件。

实例:

第一步:WXML文件:

<swiper indicator-dots="{{indicatorDots}}"   autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">   <block wx:for="{{imgUrls}}" wx:key="unique">    <swiper-item>     <image src="{{item}}" class="slide-image"/>    </swiper-item>   </block></swiper>

第二步: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: true,      autoplay: true,      interval: 3000,      duration: 500,       },  })

介绍一下参数的意思:

   indicatorDots: true,      autoplay: true,      interval: 3000,      duration: 500,

indicator-dots Boolean false 是

否显示面板指示点autoplay Boolean false 是否自动切换interval Number 5000 自动切换时间间隔duration Number 500 滑动动画时长

以上就是从零开始开发微信小程序轮播图(五)的详细内容,更多内容请关注技术你好其它相关文章!

来源链接:
免责声明:
1.资讯内容不构成投资建议,投资者应独立决策并自行承担风险
2.本文版权归属原作所有,仅代表作者本人观点,不代表本站的观点或立场
标签: 小程序
上一篇:php获取远程图片并下载保存到本地的方法分析 下一篇:从零开发微信小程序(四)

相关资讯