swiper左右抖动问题
< swiper class = 'swiper-box' bindchange = "swiperChange" wx:if = "{{listData.style.template_style == 2}}" class = 'lunbo' autoplay = '{{true}}' interval = '{{interval}}' indicator-dots = '{{listData.style.indicator == "style2"?true:false}}' circular = "{{true}}" indicator-color = "rgba(131,145,165,0.4)" indicator-active-color = "#8391a5" style = 'height:{{lunboHeight}};padding:0 {{listData.style.pmargin}}px;' > < swiper-item class = "swiper-item {{img_angle}}" wx:for = "{{listData.data}}" wx:key = "{{index}}" wx:for-item = "item" > < view class = 'swiper-img image-item {{img_style}} {{img_angle}}' bindtap = "gotoBannerDetail" data-url = "{{item.link_addr}}" style = "background-image:url({{item.imgurl}});background-size:{{listData.style.fill}};" > < image class = 'swiper-img-item' bindload = 'changeHeight' mode = 'widthFix' style = 'width:100%;' src = '{{item.imgurl}}' ></ image > < view class = 'swiper-text {{text_angle}}' wx:if = "{{item.name != ''}}" >{{item.name}}</ view > </ view > </ swiper-item > </ swiper > < view wx:if = "{{listData.style.indicator == 'style1' && listData.style.template_style == 2}}" class = "dots" style = 'padding:0 {{listData.style.pmargin}}px;' > < block wx:for = "{{listData.data}}" wx:for-index = "dotIndex" wx:key = "{{dotIndex}}" > < view class = "dot {{dotIndex == swiperCurrent?'actives':''}}" ></ view > </ block > </ view > |
- 当前 Bug 的表现(可附上截图)
手机端一开始进去页面轮播正常,退出来再进去就一直左右抖动,我这边的指示器是自定义的,所以不管用户是否操作都要改current,已经有人提过这个问题了,但没有得到具体的解决办法,是只要判断那个source就行了吗,touch和autoplay都要操作current
- 预期表现
轮播正常,不抖动
- 复现路径
- 提供一个最简复现 Demo