A页面跳转到B页面 再从B页面返回到A页面 A页面中正在做左右运动的图片会消失,然后过一会又会出现,我做动画的图片不仅在做左右运动同时他也在两张背景图片来回切换
图片是这样运动的
gailuzi_1: function() {
let isTop0 = true
let animation = uni.createAnimation({
transformOrigin: "50% 0 50%",
duration: 5200,
timingFunction: 'linear',
delay: 100
})
this.animation = animation
clearInterval(this.$timer_1.timer_1)
this.$timer_1.timer_1 = setInterval(function() {
if (isTop0 == true) {
this.opacity8 = '1' //透明度
animation.translate(485, 320).step()
this.animationData7 = animation.export()
isTop0 = !isTop0
} else if (isTop0 == false) {
this.opacity8 = '0' //透明度
animation.translate(-10, 0).step()
this.animationData7 = animation.export()
isTop0 = !isTop0
}
}.bind(this), 5600)
},
图片来回切换我是有背景图片定位做
跳转是用navigateTo()