- TweenMax 中文手册 / TweenLite 中文手册
- TweenMax()
- TweenMax.to()
- TweenMax.from()
- TweenMax.fromTo()
- TweenMax.staggerTo()
- TweenMax.staggerFrom()
- TweenMax.staggerFromTo()
- TweenMax.delayedCall()
- TweenMax.set()
- delay
- ease
- paused
- immediateRender
- overwrite
- useFrames
- lazy
- autoCSS
- callbackScope
- repeat
- repeatDelay
- yoyo
- yoyoEase
- startAt
- cycle
- onComplete
- onCompleteParams
- onCompleteScope
- onReverseComplete
- onReverseCompleteParams
- onReverseCompleteScope
- onStart
- onStartParams
- onStartScope
- onUpdate
- onUpdateParams
- onUpdateScope
- onOverwrite
- onRepeat
- onRepeatParams
- onRepeatScope
- .eventCallback()
- .play()
- .pause()
- .paused()
- .restart()
- .resume()
- .reverse()
- .reversed()
- .seek()
- .timeScale()
- .duration()
- .totalDuration()
- .time()
- .totalTime()
- .progress()
- .totalProgress()
- .delay()
- .invalidate()
- .isActive()
- .updateTo()
- .startTime()
- .endTime()
- .repeat()
- .repeatDelay()
- .yoyo()
- .data
- TweenLite.defaultEase
- TweenLite.defaultOverwrite
- TweenLite.onOverwrite
- TweenLite.selector
- .target
- .timeline
- .vars
- TweenMax.ticker
- TweenMax.getTweensOf()
- TweenMax.getAllTweens()
- .kill()
- TweenMax.killDelayedCallsTo()
- TweenMax.killTweensOf()
- TweenMax.killAll()
- TweenMax.killChildTweensOf()
- TweenLite.render()
- TweenMax.lagSmoothing()
- TweenMax.globalTimeScale()
- TweenMax.isTweening()
- TweenMax.pauseAll()
- TweenMax.resumeAll()
- 下载 TweenMax
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
.seek()
.seek( time:*, suppressEvents:Boolean ) : *
不改变状态(播放、暂停、方向)的情况下直接跳转到某个时间点。
//跳转到第2秒
myAnimation.seek(2);
//跳转到第2秒,并且不阻止期间的函数、事件
myAnimation.seek(2, false);
必须设定时间点 返回self,方便链式设置
.seek()适用于TweenMaxTweenLite
.seek()的参数
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
time | Num/label | 是 | 跳转到的时间秒数(或TimelineLite/TimelineMax的label) |
suppressEvents | Boolean | 否 | 如果true(默认值),当播放头移动到time参数中定义的新位置时,不会触发任何事件或回调。 |
.seek() 示例
body {
background-color: #f8f8f8;
font-size: 16px;
}
#demo {
width: 692px;
height: 60px;
background-color: #333;
padding: 8px;
margin-bottom: 10px;
}
.box {
width: 50px;
height: 50px;
border-radius: 6px;
margin-top: 4px;
display: inline-block;
position: absolute;
}
.green {
background-color: #6fb936;
}
input[type="button"] {
-webkit-appearance: button;
padding: 8px;
margin-right: 5px;
margin-bottom: 5px;
}
box = document.getElementById("box"),
playBtn = document.getElementById("playBtn"),
pauseBtn = document.getElementById("pauseBtn"),
resumeBtn = document.getElementById("resumeBtn"),
reverseBtn = document.getElementById("reverseBtn"),
playFromBtn = document.getElementById("playFromBtn"),
reverseFromBtn = document.getElementById("reverseFromBtn"),
seekBtn = document.getElementById("seekBtn"),
timeScaleSlowBtn = document.getElementById("timeScaleSlowBtn"),
timeScaleNormalBtn = document.getElementById("timeScaleNormalBtn"),
timeScaleFastBtn = document.getElementById("timeScaleFastBtn"),
restartBtn = document.getElementById("restartBtn"),
tween = TweenLite.to(box, 6, {left:"632px", ease:Linear.easeNone});
playBtn.onclick = function() {
//当前位置播放动画,如果动画播放完成, play() 无效
tween.play();
}
pauseBtn.onclick = function() {
tween.pause();
}
resumeBtn.onclick = function() {
//当前位置继续动画.
tween.resume();
}
reverseBtn.onclick = function() {
tween.reverse();
}
playFromBtn.onclick = function() {
//某时间点开始播放(秒).
tween.play(5);
}
reverseFromBtn.onclick = function() {
//某时间点开始返回 (秒).
tween.reverse(1);
}
seekBtn.onclick = function() {
//跳到特定时间 (秒)
tween.seek(3);
}
timeScaleSlowBtn.onclick = function() {
//减速.
tween.timeScale(0.5);
}
timeScaleNormalBtn.onclick = function() {
//恢复速度.
tween.timeScale(1);
}
timeScaleFastBtn.onclick = function() {
//加速.
tween.timeScale(2);
}
restartBtn.onclick = function() {
//重新开始.
tween.restart();
}
.seek()返回值
.seek()的补充说明
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论