例如:
</view>
<button bindtap='start'>动画</button>
</view>
start:function(){
var animation = wx.createAnimation({
duration: 4000,
timingFunction: 'ease',
delay: 1000
});
animation.opacity(0.2).translate(100, -100).step()
this.setData({
ani: animation.export()
})
}
})
https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html
参考官方示例
生命周期函数里啊 onLoad onReady onShow 或者页面滚动函数onPageScroll