wxml
<view class="content">
<block wx:key="{{img}}" wx:for="{{img}}">
<view class="pic-list">
<image src="{{ listIndex > index ? item : '' }}" class="pic {{listIndex > index ?'Action':''}}" mode="widthFix" />
</view>
</block>
</view>
js
onShow: function () {
const screenWidth = wx.getSystemInfoSync().windowWidth
const screenHeight = wx.getSystemInfoSync().windowHeight
this.setData({
listIndex: screenHeight / (screenWidth * 0.63),
screenWidth: screenWidth,
screenHeight: screenHeight
})
},
onPageScroll(e) {
let listIndex = (e.scrollTop + this.data.screenHeight) / (this.data.screenWidth * 0.63)
this.setData({
listIndex: listIndex
})
}