onStart: Function
new TimelineMax({onStart: myFunction});
.box {
width:50px;
height:50px;
border-radius:6px;
margin-top:4px;
display:inline-block
}
.green{
background-color:#6fb936;
}
var tm= new TimelineMax({delay: 2, onStart: onStart})
tm.to('.box', 2, {x: 500});
restartBtn = document.getElementById("restartBtn"),
restartBtn.onclick = function() {tm.restart();}
panel = document.getElementById("panel");
i=1;
function onStart(){
panel.innerHTML='函数触发了'+i;
i++;
}
转载原创文章请注明:文章转载自:TweenMax中文网 [https://www.tweenmax.com.cn]
本文地址:https://www.tweenmax.com.cn/api/timelinemax/onStart