Swiper中文论坛

标题: 【已解决】使用swiper3,会出现抖动 [打印本页]

作者: McChen    时间: 2016-12-28 21:13
标题: 【已解决】使用swiper3,会出现抖动
本帖最后由 McChen 于 2016-12-29 15:00 编辑
  1. var topSwiper = new Swiper ('#top-swiper', {
  2.                 initialSlide: 1,        // 初始化索引
  3.                 centeredSlides: true,        // 居中
  4.                 slidesPerView: 1.4,        // 宽度比例
  5.                 iOSEdgeSwipeDetection : true,        // iOS
  6.                 lazyLoading: true,        // 图片懒加载
  7.                 lazyLoadingInPrevNext : true,        // 加载上下张图片
  8.                 lazyLoadingOnTransitionStart : true,        // 过渡开始就加载
  9.                 roundLengths : true,        // 宽度取整
  10.                 loop: true,
  11.                 loopAdditionalSlides: 1,
  12.                 onInit: function(swiper){
  13.                         //Swiper初始化了
  14.                         swiper.container.removeClass("v-hidden");
  15.                         //alert(swiper.activeIndex);提示Swiper的当前索引
  16.                 },
  17.                 onSliderMove: function(swiper, event){
  18.                                 console.log(swiper);
  19.                                 console.log(event);
  20.                 },
  21.                 onSlideNextEnd: function(swiper){
  22. //                        console.log(swiper.realIndex);
  23. //                        console.log(swiper.slides.length);
  24.                 }
  25.         });
复制代码


代码配置如上
--------------------

  1. .swiper-slide { transform: scale(0.9); transition: transform 0.3s;}
  2.       .swiper-slide.swiper-slide-active { transform: scale(1);}
复制代码
css样式如上
------------------------

就是在我开启loop的时候,每次加载完预设数量的时候,再次滑动的该元素会先缩小再恢复active的大小,我想请问一下是否在loop的过程中,有删除或者重置swiper-slide-active的行为呢?不开启loop不会出现该情况。

补充:

swiper-slide-duplicate  这个slide切换的时候会出现这个情况,正常元素都不会。




GIF.gif (237.91 KB, 下载次数: 152)

正常不应该缩小这一下

正常不应该缩小这一下

作者: McChen    时间: 2016-12-29 14:59
自己已经通过onTouchStart,onTouchMove,onTouchEnd临时hack了这个问题。
作者: evayin    时间: 2019-5-16 08:26
McChen 发表于 2016-12-29 14:59
自己已经通过onTouchStart,onTouchMove,onTouchEnd临时hack了这个问题。

我也遇到这个问题了,能问下具体怎么解决的吗




欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/) Powered by Discuz! X3.2