<view class="roll" style="  opacity:{{headshow}};">
        <view class="title">
            好货到家
        </view>
</view>
data{
    headshow: 0
  onPageScroll: function (e) {
    let opacity = 0
    if (e.scrollTop <= 400) {
      opacity = e.scrollTop / 400
    } else {
      opacity = 1
    }
    this.setData({
      headshow: opacity
    })
  },

 

相关文章:

  • 2022-12-23
  • 2021-05-28
  • 2022-01-05
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2021-12-25
  • 2022-12-23
  • 2022-01-05
  • 2021-07-23
  • 2021-12-22
  • 2022-12-23
相关资源
相似解决方案