.isActive( ) : Boolean
只有在静止状态下才能反转动画方向
body, html {
font-family: Signika Negative, sans-serif;
background: #111;
color:#efefef;
}
.wrapper {
width:400px;
height:100px;
background:#444;
margin-bottom:10px;
}
.box {
width:100px;
height:100px;
background:#88ce02;
}
button {
margin:10px 0;
padding:10px;
}
var endX = 300;
var tm = new TimelineMax();
tm.to('.box', 2, {x:endX, ease:Linear.easeNone}).reverse();
tweenBox=document.getElementById("tweenBox")
tweenBox.onclick=function(){
if(!tm.isActive()){
//只有在tween is not active状态下才能反转动画方向
tm.reversed(!tm.reversed())
}
}
转载原创文章请注明:文章转载自:TweenMax中文网 [https://www.tweenmax.com.cn]
本文地址:https://www.tweenmax.com.cn/api/timelinemax/isActive()