微场景 swiper 监测当前页数进而做其他动作
来源:互联网 发布:一键换机软件下载 编辑:程序博客网 时间:2024/06/08 15:34
var lihong = document.getElementById('interact');
var swiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
paginationClickable: true,
watchSlidesProgress : true,
direction: 'vertical',
onInit: function(swiper){ //Swiper2.x的初始化是onFirstInit
swiperAnimateCache(swiper); //隐藏动画元素
swiperAnimate(swiper); //初始化完成开始动画
},
onSlideChangeEnd: function(swiper){
swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画
if (swiper.realIndex>0) {
alert(swiper.activeIndex)
lihong.setAttribute('style','display:block');
}else{
lihong.setAttribute('style','display:none');
};
}
});
swiper.realIndex 当前是第几页(从0开始),配合onSlideChangeEnd做判断完成一些事情。
*swiper的回调函数onSlideChangeEnd 这个函数可以在slide切换结束时做很多动作。
阅读全文
0 0
- 微场景 swiper 监测当前页数进而做其他动作
- 微场景的开发之swiper
- easyUI 获取当前页数
- iReport当前页数和总页数
- swiper 3出来了,还有动画,做场景应用更简单了
- UIScrollView分页 获取当前页数
- jqgrid 排序,获取当前页数
- 获取easyui当前页数,行数
- [swift]监测iphone自由落体动作
- 谷歌浏览器中微场景swiper中swipeUp无效问题
- H5场景动画 swiper Animate使用方法
- 使用swiper实现移动端小场景
- smartform报表当前页/总页数
- 导出当前页数据到Excel
- easyUI 获取记录数 页数 当前页
- ireport报表当前页及总页数
- easyui 获取记录数 页数 当前页
- 工作线程千万不要做 setVisiable();动作 和其他必须在UI线程中做的东东,这是常识。
- 7.Python的基本数据类型(中二)
- SSM框架-SpringMVC 实例文件上传下载
- Zookeeper 集群伪分布 在 Windows下的安装
- 视觉设计中发现的11种光学错觉
- linux安装zookeeper与dubbo
- 微场景 swiper 监测当前页数进而做其他动作
- 6.2(1)
- Linux下C语言高级编程必备!(附多文件编程代码)
- css选择器优先级
- 记一次用idea+weblogic+java+tfs项目的部署
- Python与机器学习之Numpy描述性统计
- 微信小程序切换tab时动画执行问题
- 打印*
- AMQP-0-9-1中文规范