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