|
本帖最后由 aprilfall 于 2016-1-20 21:10 编辑
新人求教,使用swiper嵌套swiper animate,有一些小Bug,求解决思路
问题描述:竖向是四个slide,竖向的第一个slide里有两个横向的slide,每个slide都有嵌入swiper animate,slide滑动正常,动画是可以显示的,但是有时候显示完过了几秒就图片消失了
- $(document).ready(function () {
- var swiperH = new Swiper('.swiper-container-h', {
- pagination: '.swiper-pagination-h',
- direction: 'horizontal',
- effect : 'fade',
- autoplay : 5000,
- loop : true,
- grabCursor : true,
- autoheight:false,
- onInit: function(swiper1){ //Swiper2.x的初始化是onFirstInit
- swiperAnimateCache(swiper1); //隐藏动画元素
- swiperAnimate(swiper1); //初始化完成开始动画
- },
- onSlideChangeEnd: function(swiper1){
- swiperAnimate(swiper1); //每个slide切换结束时也运行当前slide动画
- }
- });
- var swiperV = new Swiper('.swiper-container-v', {
- pagination: '.swiper-pagination-v',
- paginationClickable: true,
- direction: 'vertical',
- mousewheelControl : true,
- mousewheelForceToAxis : true,
- autoheight:false,
- onInit: function(swiper2){ //Swiper2.x的初始化是onFirstInit
- swiperAnimateCache(swiper2); //隐藏动画元素
- swiperAnimate(swiper2); //初始化完成开始动画
- },
- onSlideChangeEnd: function(swiper2){
- swiperAnimate(swiper2); //每个slide切换结束时也运行当前slide动画
- }
- });
- });
复制代码
|
|