html52.com
我爱小程序-开发者交流社区

swiper 图片抖动问题

问题模块 框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
API和组件 小程序 Bug swiper 客户端 6.5.3 1.9.93

小程序顶部banner图在模拟环境中没有问题,但是发布之后,在真机中就一直抖动,如下图

小程序顶部banner图在模拟环境中没有问题,但是发布之后,在真机中就一直抖动,如下图<scroll-view style="width:100%;height:100%" scroll-y="true" bindscroll


<scroll-view style="width:100%;height:100%" scroll-y="true" bindscroll="scrollTopFun" scroll-with-animation="true" scroll-top="{{scrollTop}}">

<view class="page-section page-section-spacing" bindtap="goJnh">


<swiper  class="swiper" indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" circular="{{circular}}" vertical="{{vertical}}" interval="{{interval}}" duration="{{duration}}" previous-margin="{{previousMargin}}px" next-margin="{{nextMargin}}px" bindchange='bindchange' current="{{current}}" style="height:{{imgheights[current]}}rpx;">

<block wx:for="{{background}}" wx:key="*this">

<swiper-item>

<image mode="widthFix" src="{{item}}" bindload="imageLoad" data-index='{{index}}' class="slide-image" width="355" height="200" />

</swiper-item>

</block>

</swiper>

<text class="banner-text">国家AAAA级景区———金牛湖旅游度假区</text>

</view>



网友回复

曾军:

JS代码:

wx.request({//获取banner列表

url: //隐藏。。

method: "GET",

header: {

'Content-Type': 'json'

},

success: function (res) {

that.setData({

background: res.data.list,

imgUrls: res.data.list

})

}

})



Page({

data: {

trafficList: [],

ticketList: [],

background: [],

indicatorDots: true,

vertical: false,

autoplay: true,

circular: false,

interval: 2000,

duration: 500,

previousMargin: 0,

nextMargin: 0,

curPage: 1,

current: 0,

x: 0,

hotelList:[],

hotList:[],

foodList:[],

src: "",

audioAction: {

method: 'pause'

},

index: -1,

navTop:0,

navTop2: 10000,

hotTop:0,

footTop:0,

hotelTop:0,

ticketTop:0,

trafficTop:0,

showNavSelet:'hot',

imgheights: [],


imgUrls: [],

swiperIndex: 0

},

onLoad: function () {

let hotelList = [], hotList = [], that = this;

wx.showLoading({

title: '加载中',

})



亮子?:

你看下你的js代码 是不是写的有问题呀  可能陷入了死循环中

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付