.progress()

.progress( value:Number, suppressEvents:Boolean ) : *
获取或者设置时间轴的进程,返回该时间轴以便链式调用。
时间轴的进程为开始时是0,到终点时是1。
var progress = myTimeline.progress(); //获取progress
myTimeline.progress( 0.25 ); //设置progress
.progress()适用于TimelineMaxTimelineLite

.progress()的参数

参数 类型 必填 说明
value Number 设置progress或者留空读取progress,(default = NaN)
suppressEvents Boolean 如果true(default = false),当播放头移动到新位置时,不会触发任何事件或回调。

.progress()效果展示

  • HTML
  • CSS
  • JS
  • 展示

立即设置时间轴跳转到终点。

.box {
    width:50px;
    height:50px;
    border-radius:6px;
    margin-top:4px;
  }
.green{
    background-color:#6fb936;
  }
var tl = new TimelineMax();
tl.add(TweenMax.to(".box", 2, {x:500})).progress(1);
重播

转载原创文章请注明:文章转载自:TweenMax中文网 [https://www.tweenmax.com.cn]
本文地址:https://www.tweenmax.com.cn/api/timelinemax/progress()