Created
April 19, 2017 09:24
-
-
Save theWhiteFox/e7c456bfa747b0d033f5e1b29896b28f to your computer and use it in GitHub Desktop.
TweenMax.staggerTo()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link href='http://fonts.googleapis.com/css?family=Asap:400,700' rel='stylesheet' type='text/css'> | |
| <link href='http://fonts.googleapis.com/css?family=Signika' rel='stylesheet' type='text/css'> | |
| <h2>TweenMax.staggerTo()</h2> | |
| <div id="demo"> | |
| <p>The start times of each animation are staggered by 0.5 seconds</p> | |
| <div class="box green"></div> | |
| <div class="box grey"></div> | |
| <div class="box orange"></div> | |
| <div class="box green"></div> | |
| <div class="box grey"></div> | |
| <div class="box orange"></div> | |
| <div class="box green"></div> | |
| <div class="box grey"></div> | |
| <div class="box orange"></div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TweenMax.staggerTo(".box", 1, {rotation:360, y:100}, 0.5); | |
| //The stagger parameter (0.5) controls the amount of time between the start of each tween. Change it to 0.2, 1 or 3 to see how it works. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.5/TweenMax.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment