小程序
小游戏
企业微信
微信支付
扫描小程序码分享
在onshow里执行一系列动画,第一次执行完这个动画效果没问题,下一次在进入这个页面,动画效果有的时候只执行一些,有的不执行是什么情况
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
getAnimation:function(){
var animationlf = wx.createAnimation({ //各种动画加载
duration: 800,
timingFunction: 'ease',
transformOrigin: '100% 0 0'
})
var animationrt = wx.createAnimation({
transformOrigin: '0 0 0'
var animationlficon = wx.createAnimation({
duration: 500,
timingFunction: 'ease'
var animationrticon = wx.createAnimation({
var animationdata = wx.createAnimation({
this.animationlf = animationlf
this.animationrt = animationrt
this.animationlficon = animationlficon
this.animationrticon = animationrticon
this.animationdata = animationdata
this.unBindAnimation();
console.log("this.data.animationLf", this.data.animationLf)
console.log("this.data.animationLficon", this.data.animationLficon)
setTimeout(function(){
animationlf.opacity(1).scale(1).step()
this.setData({
animationLf: animationlf.export()
// console.log(this.data.animationLf)
setTimeout(function () {
animationlficon.opacity(1).step()
animationdata.opacity(1).step()
animationrt.opacity(1).scale(1).step()
animationRt: animationrt.export(),
animationLficon: animationlficon.export(),
animationLfdata: animationdata.export()
animationrticon.opacity(1).step()
animationRticon: animationrticon.export(),
}.bind(this), 1000)
}.bind(this),100)
animationImg: animationlficon.export()
}.bind(this), 2300)
},
unBindAnimation: function () {
duration: 10,
var animationrt = wx.createAnimation({ //各种动画加载
var animationimg = wx.createAnimation({
this.animationimg = animationimg
animationlf.opacity(0).scale(0).step()
animationrt.opacity(0).scale(0).step()
animationlficon.opacity(0).step()
animationrticon.opacity(0).step()
animationdata.opacity(0).step()
animationimg.opacity(0).step()
animationLf: animationlf.export(),
animationLfdata: animationdata.export(),
animationImg: animationimg.export()
是我写的太复杂了么
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
你好,请提供一下能复现问题的简单代码示例。
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
getAnimation:function(){
var animationlf = wx.createAnimation({ //各种动画加载
duration: 800,
timingFunction: 'ease',
transformOrigin: '100% 0 0'
})
var animationrt = wx.createAnimation({
duration: 800,
timingFunction: 'ease',
transformOrigin: '0 0 0'
})
var animationlficon = wx.createAnimation({
duration: 500,
timingFunction: 'ease'
})
var animationrticon = wx.createAnimation({
duration: 500,
timingFunction: 'ease'
})
var animationdata = wx.createAnimation({
duration: 500,
timingFunction: 'ease'
})
this.animationlf = animationlf
this.animationrt = animationrt
this.animationlficon = animationlficon
this.animationrticon = animationrticon
this.animationdata = animationdata
this.unBindAnimation();
console.log("this.data.animationLf", this.data.animationLf)
console.log("this.data.animationLficon", this.data.animationLficon)
setTimeout(function(){
animationlf.opacity(1).scale(1).step()
this.setData({
animationLf: animationlf.export()
})
// console.log(this.data.animationLf)
setTimeout(function () {
animationlficon.opacity(1).step()
animationdata.opacity(1).step()
animationrt.opacity(1).scale(1).step()
this.setData({
animationRt: animationrt.export(),
animationLficon: animationlficon.export(),
animationLfdata: animationdata.export()
})
setTimeout(function () {
animationrticon.opacity(1).step()
this.setData({
animationRticon: animationrticon.export(),
})
}.bind(this), 1000)
}.bind(this), 1000)
}.bind(this),100)
setTimeout(function () {
animationlficon.opacity(1).step()
this.setData({
animationImg: animationlficon.export()
})
}.bind(this), 2300)
},
unBindAnimation: function () {
var animationlf = wx.createAnimation({ //各种动画加载
duration: 10,
timingFunction: 'ease',
transformOrigin: '100% 0 0'
})
var animationrt = wx.createAnimation({ //各种动画加载
duration: 10,
timingFunction: 'ease',
transformOrigin: '0 0 0'
})
var animationlficon = wx.createAnimation({
duration: 10,
timingFunction: 'ease'
})
var animationrticon = wx.createAnimation({
duration: 10,
timingFunction: 'ease'
})
var animationdata = wx.createAnimation({
duration: 10,
timingFunction: 'ease'
})
var animationimg = wx.createAnimation({
duration: 10,
timingFunction: 'ease'
})
this.animationlf = animationlf
this.animationrt = animationrt
this.animationlficon = animationlficon
this.animationrticon = animationrticon
this.animationdata = animationdata
this.animationimg = animationimg
animationlf.opacity(0).scale(0).step()
animationrt.opacity(0).scale(0).step()
animationlficon.opacity(0).step()
animationrticon.opacity(0).step()
animationdata.opacity(0).step()
animationimg.opacity(0).step()
this.setData({
animationLf: animationlf.export(),
animationRt: animationrt.export(),
animationLficon: animationlficon.export(),
animationRticon: animationrticon.export(),
animationLfdata: animationdata.export(),
animationImg: animationimg.export()
})
},
是我写的太复杂了么
你好,请提供一下能复现问题的简单代码示例。