微信小程序swiper滑动页面
来源:互联网 发布:域名备案查询 编辑:程序博客网 时间:2024/05/18 08:45
基本属性
属性名 类型 默认值 说明 最低版本
indicator-dots Boolean false 是否显示面板指示点
indicator-color Color rgba(0, 0, 0, .3) 指示点颜色 1.1.0
indicator-active-color Color #000000 当前选中的指示点颜色 1.1.0
autoplay Boolean false 是否自动切换
current Number 0 当前所在页面的 index
interval Number 5000 自动切换时间间隔
duration Number 500 滑动动画时长
circular Boolean false 是否采用衔接滑动
bindchange EventHandle current 改变时会触发 change 事件,event.detail = {current: current}
WXML
<view> <text>swiper展示</text> <!-- 1,是否显示面板指示点 2,是否自动切换 3,自动切换时间间隔 4,滑动动画时长--> <swiper indicator-dots='{{indicatorDots}}' autoplay='{{autoplay}}' interval='{{interval}}' duration='{{duration}}'> <block wx:for="{{imgUrls}}"> <swiper-item> <image src="{{item}}" /> </swiper-item> </block> </swiper></view>
JS
Page({ /** * 页面的初始数据 */ data: { imgUrls:[ '../../imags/test.png', '../../imags/test-shouye.png', '../../imags/test02.jpg' ], indicatorDots:true, autoplay:true, interval:1000, 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.data.value }) }, durationChange:function(e){ this.setData({ duration:e.data.value }) })
效果图如下:
阅读全文
0 0
- 微信小程序swiper滑动页面
- 微信小程序swiper滑动页面实践-类似于安卓ViewPager
- 微信小程序swiper滑动页面实践-类似于安卓ViewPager
- 微信小程序8-swiper(滑动面板)
- 微信小程序 swiper 点击切换,左右滑动,自动滑动
- 关于滑动切换页面swiper的坑
- 微信小程序swiper如何获得当前页面的index
- 微信小程序 swiper 应用
- 微信小程序之swiper轮播图
- 微信小程序入门之swiper
- 微信小程序中的swiper组件
- 微信小程序----组件之swiper
- 微信小程序 自定义 swiper 样式
- 微信小程序swiper使用注意
- 微信小程序之swiper轮播图
- 微信小程序 监听手势滑动切换页面
- swiper实现触摸滑动
- Swiper 滑动插件
- mysql查询所有分类的前5行结果
- 栈和队列——构造数组的MaxTree(java实现)
- 用js写了一个判断矩形相交的函数
- 经典卷积神经网络(CNN)实现MNIST分类(基于LeNet-5模型)
- leetcode 637. Average of Levels in Binary Tree
- 微信小程序swiper滑动页面
- java String类
- Qt数据类型转换
- Lucene5 学习笔记(3) —— 重用 IndexReader 和常用的搜索方法
- SQL优化索引
- ubuntu16.04 标题栏显示网速、CPU使用率
- 如何解决apt-get中Unmet dependencies问题
- C#220课的主要内容
- 微信小程序WXML之列表渲染