<!DOCTYPE HTML><HTML><HeadLang= "en"> <MetaCharSet= "UTF-8"> <title>Hello greensock!</title> <Linkhref= ' http://fonts.googleapis.com/css?family=Asap:400,700 'rel= ' stylesheet 'type= ' Text/css '> <Linkhref= ' Http://fonts.googleapis.com/css?family=Signika 'rel= ' stylesheet 'type= ' Text/css '> <Linkhref= ' Main.css 'rel= ' stylesheet 'type= ' Text/css '></Head><Body><H2>Tweenmax.staggerto ()</H2><DivID= "Demo"> <P>The start times of each animation is staggered by 0.5 seconds</P> <Divclass= "Box Green"></Div> <Divclass= "box Grey"></Div> <Divclass= "Box Orange"></Div> <Divclass= "Box Green"></Div> <Divclass= "box Grey"></Div> <Divclass= "Box Orange"></Div> <Divclass= "Box Green"></Div> <Divclass= "box Grey"></Div> <Divclass= "Box Orange"></Div></Div></Body><Scriptsrc= "//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></Script><Scriptsrc= "//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></Script><Scriptsrc= "//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-animate.min.js"></Script><Scriptsrc= "Http://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.6/TweenMax.min.js"></Script><Scriptsrc= "App.js"></Script></HTML>
Css:
html, Body{Height:100%;}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{Height:100%;position:relative;}. Box{width:50px;Height:50px;position:relative;Border-radius:6px;Margin-top:4px;Display:Inline-block}. Green{Background-color:#6fb936;}. Orange{Background-color:#f38630;}. Grey{Background-color:#989898;}
Javascript:
Tweenmax.staggerto (". Green", 1.5, {rotation:360, y:100, x:50}, 0.5//class= "green" box ratate degree to Y = 10 0, X = every 0.5s, one green box start to moveTweenmax.staggerto (
The difference bewteen Staggerto () and to () method are, Staggerto trigger element one by one, but to () trigger all El Ements at once.
[CSS3 Animation] Tweenmax.staggerto ()