delay
优质
小牛编辑
134浏览
2023-12-01
delay:Number
动画开始之前的延迟秒数(以帧为单位时则为帧数)。 delay适用于TweenMaxTweenLitedelay的参数
delay 示例
延迟三秒开始动画
body {
background: #f8f8f8;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color: #000;
margin: 0 10px;
padding: 0;
}
.box {
width:50px;
height:50px;
line-height:50px;
text-align:center;
color:#fff;
font-size:18px;
border-radius:6px;
margin-top:4px;
display:inline-block
}
.green{
background-color:#6fb936;
}
new TweenMax('.box', 3, {
x: 500,
delay: 3
});
time={score:3}
TweenMax.to(time, 3, {
score: 0,
ease: Power0.easeNone,
onUpdate:function(){
document.querySelector(".box").innerHTML=Math.ceil(time.score);
}
});