- TimelineMax 中文手册 / TimelineLite 中文手册
- TimelineMax()
- .add()
- .addCallback()
- .addLabel()
- .addPause()
- .remove()
- .removeCallBack()
- .removeLabel()
- .removePause()
- .to()
- .from()
- .fromTo()
- .staggerTo()
- .staggerFrom()
- .staggerFromTo()
- .set()
- delay
- paused
- useFrames
- tweens
- stagger
- align
- autoRemoveChildren
- smoothChildTiming
- repeat
- repeatDelay
- yoyo
- callbackScope
- onStart
- onStartParams
- onStartScope
- onComplete
- onCompleteParams
- onCompleteScope
- onReverseComplete
- onReverseCompleteParams
- onReverseCompleteScope
- onUpdate
- onUpdateParams
- onUpdateScope
- onRepeat
- onRepeatParams
- onRepeatScope
- .play()
- .pause()
- .paused()
- .restart()
- .resume()
- .reverse()
- .reversed()
- .seek()
- .timeScale()
- .tweenTo()
- .tweenFromTo()
- .delay()
- .repeat()
- .repeatDelay()
- .duration()
- .totalDuration()
- .progress()
- .totalProgress()
- .time()
- .totalTime()
- .endTime()
- .startTime()
- .yoyo()
- .autoRemoveChildren
- .data
- .smoothChildTiming
- .timeline
- .call()
- .clear()
- .currentLabel()
- .eventCallback()
- TimelineMax.exportRoot()
- .getActive()
- .getChildren()
- .getLabelAfter()
- .getLabelBefore()
- .getLabelsArray()
- .getLabelTime()
- .getTweensOf()
- .invalidate()
- .isActive()
- .kill()
- .recent()
- .shiftChildren()
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
.addPause()
.addPause( position:*, callback:Function, params:Array, scope:* ) : *
在时间轴上添加一个暂停点。
//在2秒处添加一个暂停点
timeline.addPause(2);
//在"yourLabel"标签处添加一个暂停点
timeline.addPause("yourLabel");
//在"yourLabel"标签3秒后添加一个暂停点,暂停时触发yourFunction函数
timeline.addPause("yourLabel+=3", yourFunction);
//添加一个暂停点在时间轴4秒处,暂停时触发yourFunction函数并将参数"param1"和"param2"以及作用域传递给该函数。
timeline.addPause(4, yourFunction, ["param1", "param2"], this);
.addPause()适用于TimelineMaxTimelineLite
.addPause()的参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
position | * | 否 | 添加暂停点的位置,可基于绝对时间(帧)、相对时间("+=" "-=")或其他标签("myLabel+=2")。 默认为"+=0",在时间轴末尾 |
callback | Function | 否 | 到达暂停点时触发的回调函数,default = null |
params | Array | 否 | 传递回调的参数数组。default = null |
scope | * | 否 | 回调调用的范围(一般代表函数中"this"指的是什么),default = null |
.addPause() 示例
.box {
width:50px;
height:50px;
border-radius:6px;
margin-top:4px;
}
.green{
background-color:#6fb936;
}
panel= document.getElementById("panel");
myFunction = function(){
panel.innerHTML='时间轴暂停并触发了函数!';
}
var tm = new TimelineMax();
tm.to(".box", 4, {x:500})
.addPause("-=1",myFunction)
.to(".box", 3, {y:200});
.addPause()返回值
返回该时间轴以便链式调用。
.addPause()的补充说明
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论