TweenLite.onOverwrite : Function
TweenLite.onOverwrite = function(overwritten, overwriting, target, props) {...}
参数 | 类型 | 说明 |
---|---|---|
overwrittenTween | Tween | 被覆盖的补间动画 |
overwritingTween | Tween | 覆盖的补间动画 |
target | Object |
动画目标(只有"auto"模式才会传递此参数),与overwrittenTween.target类似 例如:TweenLite.to([obj1, obj2], 1, {x:100}) 和 TweenLite.to(obj2, 1, {x:50}), 目标应是 obj2 |
overwrittenProperties | Array |
一个属性数组,包含了被覆盖的动画属性(只有"auto"模式才会传递此参数), 例如:["x","y","opacity"] |
Box
.box {
width:50px;
height:50px;
line-height:50px;
text-align:center;
color:#fff;
border-radius:6px;
margin-top:4px;
display:inline-block
}
.green{
background-color:#6fb936;
}
TweenLite.onOverwrite = function(overwritten, overwriting, target, props) {
console.log("被覆盖的动画");
console.log(overwritten);
console.log("覆盖的动画")
console.log(overwriting);
console.log("被覆盖的动画的目标对象");
console.log(target.innerHTML);
console.log("被覆盖的属性");
console.log(props);
}
TweenLite.to(".green", 2, {x:400, y:200});
//after 1 second the next tween will overwrite the x property of the previous tween
TweenLite.to(".green", 1, {x:100, delay:1});
转载原创文章请注明:文章转载自:TweenMax中文网 [https://www.tweenmax.com.cn]
本文地址:https://www.tweenmax.com.cn/api/tweenmax/TweenLite.onOverwrite