使用swiper制作微场景遇到的问题

1、swiper每页上都有动画,当翻到此页时动画才会显示,但是会遇到翻页翻到一半并没有完全翻过去,导致此页的动画已经隐藏,而下一页的动画还没有执行,所以会出现画面空白的问题。

解决方法是增加onTouchEnd的回调

                var mySwiper = new Swiper ('.swiper-container', {
			   direction : 'vertical',
			   pagination: '.swiper-pagination',
			   mousewheelControl : true,
			   loop:true,
			   onInit: function(swiper){
				   swiperAnimateCache(swiper);
				   swiperAnimate(swiper);
			   },
			   onSlideChangeEnd: function(swiper){
				   swiperAnimate(swiper);
			   },
			   onTouchEnd: function (swiper) {                  
                                   swiperAnimate(swiper);
                           }	  
		   });
原文地址:https://www.cnblogs.com/zhanglm125/p/6610074.html