- 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
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
TweenMax.staggerFromTo()
TweenMax.staggerFromTo( targets:Array, duration:Number, fromVars:Object, toVars:Object, stagger:Number, onCompleteAll:Function, onCompleteAllParams:Array, onCompleteAllScope:* ) : Array
通过设定序列动画的起点和终点来初始化一个TweenMax。var objects = [obj1, obj2, obj3, obj4, obj5];
TweenMax.staggerFromTo(objects, 1, {opacity:1}, {opacity:0}, 0.2);
还可以使用cycle属性。 TweenMax.staggerFromTo()适用于TweenMaxTweenMax.staggerFromTo()的参数
参数名 | 类型 | 是否必填 | 描述 |
---|---|---|---|
targets | Array | 是 | 要进行动画的对象,可以有多个,以数组形式传入 |
duration | number | 是 | 动画持续的秒数(或帧数,如果设置了useFrames:true) |
fromVars | object | 是 | 设置动画的一些属性及其他参数 |
toVars | object | 是 | 设置动画的一些属性及其他参数 |
stagger | Number | 否 | 每个动画的间隔,默认是0 |
onCompleteAll | Function | 否 | 当所有显示对象都完成动画后要调用的函数 |
onCompleteAllParams | Array | 否 | 传递给onCompleteAll函数的参数,以数组形式传入 |
onCompleteAllScope | 否 | onCompleteAll函数的作用域 |
TweenMax.staggerFromTo() 示例
TweenMax.staggerFromTo() with cycle
cycle属性允许你在所有TweenMax、TimelineLite和 TimelineMax插件中基于stagger的函数里面,定义一个array的属性值或者function的属性值 (注释中有详细列表)。
body {
background-color:#1d1d1d;
font-family: "Asap", sans-serif;
color:#989898;
margin:0 10px;
font-size:16px;
}
h1, h2, h3 {
font-family: "Signika Negative", sans-serif;
margin: 10px 0 10px 0;
color:#f3f2ef;
}
h1 {
font-size:36px;
}
h2 {
font-size:30px;
}
h3 {
font-size:24px;
}
p{
line-height:22px;
margin-bottom:16px;
width:650px;
}
#demo {
position:relative;
}
.box {
width:50px;
height:50px;
position:relative;
border-radius:6px;
margin:4px;
display:inline-block;
background:grey;
}
.green{
background-color:#6fb936;
}
.orange {
background-color:#f38630;
}
.grey {
background-color:#989898;
}
TweenMax.staggerFromTo(".box", 1, {
cycle:{
//an array of values
backgroundColor:["red", "white", "#00f"],
//function that returns a value
y:function(index){
return index * 10;
}
}
},
{
cycle:{
//an array of values
backgroundColor:["green", "orange", "pink"],
//function that returns a value
y:function(){
return (Math.random() * 100) + 20;
}
}
}, 0.5);
/* The cycle property is available in:
TweenMax.staggerFromTo()
TweenMax.staggerFrom()
TweenMax.staggerTo()
TimelineLite.staggerFromTo()
TimelineLite.staggerFrom()
TimelineLite.staggerTo()
TimelineMax.staggerFromTo()
TimelineMax.staggerFrom()
TimelineMax.staggerTo()
*/
TweenMax.staggerFromTo()返回值
TweenMax.staggerFromTo()的补充说明
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论