onReverseComplete
优质
小牛编辑
132浏览
2023-12-01
onReverseComplete: Function
时间轴反向播放完成时执行。
new TimelineMax({onReverseComplete: myFunction});
onReverseComplete适用于TimelineMaxTimelineLite
onReverseComplete的参数
onReverseComplete 示例
.box {
width:50px;
height:50px;
border-radius:6px;
margin-top:4px;
display:inline-block
}
.green{
background-color:#6fb936;
}
var tm= new TimelineMax({onReverseComplete: onReverseComplete})
tm.to('.box', 2, {x: 500});
panel= document.getElementById("panel");
function onReverseComplete(){
panel.innerHTML='函数触发了';
}
reverseBtn = document.getElementById("reverseBtn"),
reverseBtn.onclick = function() {tm.reverse();}