【微信小程序】swiper-滚动的banner
2018-02-27 10:36
330 查看
swiper.wxml<view class="page-section page-section-spacing swiper">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{imgUrls}}" wx:key="*this">
<swiper-item>
<image src="{{item}}" class="slide-image" width="" height="150"/>
</swiper-item>
</block>
</swiper>
</view>
swiper.js
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{imgUrls}}" wx:key="*this">
<swiper-item>
<image src="{{item}}" class="slide-image" width="" height="150"/>
</swiper-item>
</block>
</swiper>
</view>
swiper.js
Page({ data: { imgUrls: [ 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 'http://www.junfawl.cn/skin/images/5780c309432c5.jpg', 'http://www.junfawl.cn/uploads/allimg/171019/1-1G019214Q63W.jpg' ], indicatorDots: true, vertical: false, autoplay: false, interval: 2000, duration: 500 }, 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 }) } })
相关文章推荐
- 微信小程序--使用swiper实现滚动广告
- 微信小程序: swiper 的 swiper-item 下 scroll-view 无法滚动
- swiper3d横向滚动多张炫酷切换banner
- [微信小程序]滚动选择器
- 微信小程序含视频组件的banner轮播使用心得
- 微信小程序开发之实现个滚动的效果的两种方法
- 微信小程序 开发之滑块视图容器(swiper)详解及实例代码
- 微信小程序顶部可滚动导航效果
- 微信小程序 scroll-view滚动到索引位置
- 微信小程序 仿美团分类菜单 swiper分类菜单
- 微信小程序 仿美团分类菜单 swiper分类菜单
- 微信小程序数字滚动小插件
- 微信小程序 左侧菜单监听右侧滚动判断左侧菜单触发
- 如何自定义微信小程序swiper轮播图面板指示点的样式
- 微信小程序 页面的的滚动问题
- 微信小程序 解决swiper不显示图片的方法
- 微信小程序遮罩层阻止滚动条滚动
- 微信小程序scroll-view横向滚动
- (四)微信小程序之实现轮番效果(swiper)