微信小程序 开发之滑块视图容器(swiper)详解及实
网络编程 2021-07-04 19:20www.168986.cn编程入门
这篇文章主要介绍了微信小程序 开发之滑块视图容器(swiper)详解及实例代码的相关资料,需要的朋友可以参考下
微信小程序 开发之滑块视图容器详解
实现效果图:
实现起来特别简单,看看代码是怎么写的呢:
<swiper class="swiper" indicator-dots="{{indcatorDots}}" aulay="{{autoPlay}}" interval="{{interval}}" duration="{{duration}}"> <block wx:for="{{imgUrls}}" wx:for-index="index"> <swiper-item> <image src="{{item}}" class="side-img"></image> </swiper-item> </block> </swiper>
这就是布局了,看一下js里面代码:
Page({ data: { imgUrls: [ 'http://img02.tooopen./images/20150928/tooopen_sy_143912755726.jpg', 'http://img06.tooopen./images/20160818/tooopen_sy_175866434296.jpg', 'http://img06.tooopen./images/20160818/tooopen_sy_175833047715.jpg'], indcatorDots: true, autoPlay: true, interval: 5000, duration: 500 },
,swiper有以下一些常用属性:
标记的两个属性暂时不管。
注意:其中只可放置组件,否则会导致未定义的行为。
swiper-item
仅可放置在组件中,宽高自动设置为100%。
就是这样,自己动手试试。
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
上一篇:jquery实现数字输入框
下一篇:js实现无缝滚动图(可控制当前滚动的方向)
编程语言
- 机械手焊接机器人编程 机械手焊接设备编程
- vb数据库编程实例,vb做数据库
- tiobe世界编程语言排行榜,全球编程语言排行
- 成都java编程培训 成都it编程培训中心
- 编程基础培训,编程基础知识培训
- flash游戏编程基础教程,flash游戏开发教程
- 不会英语能学编程吗 不会英语可以学程序员吗
- 爱心代码编程C语言 爱心代码编程c语言公式
- c语言编程学习入门 c语言编程快速入门
- 西门子plc编程培训 西门子plc编程培训班
- 哪里可以学编程 台州哪里可以学编程
- 少儿编程哪个好 少儿编程哪个品牌好
- 编程是什么意思,图形编程是什么意思
- c语言编程软件下载,c语言编程软件在哪下载
- java编程软件下载,java编程下载手机版
- ug编程培训学校,ug编程培训教程