Topics Covered in This GreenSock Tutorial:
Master TweenMax's StaggerFrom() Method, harness TransformPerspective for sophisticated 3D animations, and leverage TransformOrigin to control 3D transformation anchor points with precision.
Exercise Preview

Photos courtesy of istockphoto: Hakan Çaglav, Image #14393929; Renee Keith, Image ##7827478
Exercise Overview
Creating professional-grade animations doesn't require complex code libraries or extensive JavaScript knowledge. TweenMax's staggering methods represent one of the most powerful tools in modern web animation, allowing developers to orchestrate sophisticated sequences with minimal effort. In this exercise, we'll explore the staggerFrom() method to create fluid, sequential animations across multiple DOM elements while incorporating 3D transforms that add visual depth and engagement.
You'll learn how small parameter adjustments can dramatically alter animation feel, and discover why staggered animations are essential for creating polished user experiences that guide attention without overwhelming viewers. By the end, you'll have both the technical skills and design intuition to implement these techniques in production environments.
This tutorial requires Google Chrome for optimal 3D transform support and basic familiarity with jQuery selectors and DOM manipulation.
Previewing the Finished Animation
Launch Google Chrome to preview our target animation. While other modern browsers support these features, Chrome provides the most consistent 3D rendering for development work.
Press Cmd–O (Mac) or Ctrl–O (Windows), navigate to Desktop > Class Files > yourname-GSAP Class > Staggered Animation, and open finished.html.
Focus on the show information cards as they animate into view. Notice the sequential timing—each element follows the previous one with precise spacing, creating a cascading effect. The 3D flip rotation adds dimensionality that would be impossible with traditional CSS transitions alone.
Reload the page multiple times to analyze the timing relationships. Pay attention to how the stagger creates visual rhythm and guides your eye naturally down the page.
Examining the DOM Structure & JavaScript
Before diving into animation code, let's understand the foundation we're building upon. Well-structured HTML makes animation implementation significantly more straightforward.
Open start.html from the Staggered Animation folder in your preferred code editor.
Examine lines 15–42 to familiarize yourself with the DOM structure we'll animate. Four elements share the class show, providing the consistent selector we need for batch operations. Each show follows this semantic structure pattern:
<div class="show"> <div class="pic"><img src="img/thumb-dusty-shoes.jpg"></div> <h3>Dusty Shoes</h3> <div>Sunday, June 8th</div> <div>Show: 2PM $10</div> <div class="button">Tickets</div> </div>NOTE: The CSS is pre-configured for this exercise, but examining style.css in the css folder will help you understand how transforms interact with existing layouts.
Around lines 53–56, locate these four critical JavaScript variables. The
$showsvariable (shown in bold) will be our primary animation target:var $header = $("#header"), $logo = $("#header img"), $upcoming = $("#upcoming"), $shows = $(".show");//selects every element with a class of showThis jQuery selector captures all four show elements simultaneously—a key efficiency that makes staggered animations possible. Rather than writing individual tweens for each element, we'll animate the entire collection as one operation.
Review the existing TweenLite animations that handle the page header elements. These provide context and demonstrate how multiple animations can work together to create cohesive page load sequences:
TweenLite.from($header, 0.5, {opacity:0}); TweenLite.from($logo, 0.5, {scale:0.5, rotation:-20, ease:Back.easeOut}); TweenLite.from($upcoming, 0.5, {opacity:0, delay:0.5});Notice how delays create sequential timing even in separate tweens—this concept scales beautifully with staggered animations.
Preview start.html in your browser to see the base animation behavior. The header elements animate smoothly, creating anticipation for the show cards we'll animate next.
There are four elements that share a class of show. Each show is structured with a pic div, h3 title, date, show info, and button.DOM Setup Process
Examine HTML Structure
Review lines 15-42 to understand the four show elements and their shared class structure.
Identify jQuery Variables
Locate the $shows variable around lines 53-56 that selects all elements with class 'show'.
Review Existing Tweens
Study the pre-coded TweenLite animations for header, logo, and upcoming elements.
TweenMax's StaggerFrom() Method
The staggerFrom() method transforms single-element animation thinking into sophisticated sequence orchestration. Let's build up to its full power gradually.
First, let's establish a baseline with standard TweenLite. After the last from() tween (around line 60), add this basic fade-in animation:
TweenLite.from($upcoming, 0.5, {opacity:0, delay:0.5}); TweenLite.from($shows, 1, {opacity:0, delay:1});This approach treats all show elements as a single unit, fading them in simultaneously over one second.
Save and preview the animation. The one-second delay allows the header sequence to complete before the shows appear—timing that creates natural visual progression.
Now we'll upgrade to TweenMax's staggering capability. Delete the TweenLite line you just added and replace it with this staggerFrom() implementation:
TweenLite.from($upcoming, 0.5, {opacity:0, delay:0.5}); TweenMax.staggerFrom($shows, 0.4, {opacity:0, delay:1});We've shortened the duration to 0.4 seconds since each element will animate individually rather than waiting for the full group duration.
Preview this version. The animation appears identical because we haven't yet specified the crucial stagger parameter that creates sequential timing.
Add the stagger interval to activate the sequential behavior:
TweenMax.staggerFrom($shows, 0.4, {opacity:0, delay:1}, 1);This fourth parameter—the stagger value—defines the time offset between each element's animation start. The syntax always places this value after the properties object, measured in seconds.
Preview the page again. Each show element now begins its fade-in one full second after the previous one starts—creating clear sequential behavior, though perhaps too slowly for most user interfaces.
Adjust the stagger timing to 0.2 seconds for a more rapid-fire effect:
TweenMax.staggerFrom($shows, 0.4, {opacity:0, delay:1}, 0.2);Test the faster timing. The overlapping animations create a cascading effect, but may feel rushed for this particular interface.
Set the stagger equal to the duration for perfectly spaced, non-overlapping animations:
TweenMax.staggerFrom($shows, 0.4, {opacity:0, delay:1}, 0.4);This timing relationship—stagger equals duration—often provides the cleanest visual rhythm for interface elements.
Preview this balanced timing. The rhythm feels natural and purposeful, but we can enhance the visual impact significantly with 3D transforms.
TweenLite vs TweenMax for Staggered Animation
| Feature | TweenLite.from() | TweenMax.staggerFrom() |
|---|---|---|
| Animation Type | Simultaneous | Sequential |
| Timing Control | Single delay | Individual stagger intervals |
| Code Complexity | Simple | Additional stagger parameter |
| Visual Impact | Basic | Professional cascading effect |
Stagger Timing Comparison
Using TransformPerspective to Animate in 3D
Modern browsers' 3D capabilities allow us to create animations that were previously impossible without complex libraries or plugins. However, effective 3D animation requires understanding perspective—the virtual camera position that determines how dramatic your transforms appear.
Enhance our stagger with 3D rotation along the X-axis:
TweenMax.staggerFrom($shows, 0.4, {opacity:0, rotationX:-90, delay:1}, 0.4);rotationX rotates elements around their horizontal axis. Starting at -90 degrees positions each show element as if lying flat, then animating to 0 degrees (normal position) creates a flipping motion.
Save and preview this addition. The animation shows vertical stretching rather than convincing 3D rotation because we haven't established a perspective point—the virtual camera position that creates depth illusion.
Add perspective above the staggerFrom() call to create proper 3D distortion:
TweenLite.from($upcoming, 0.5, {opacity:0, delay:0.5}); CSSPlugin.defaultTransformPerspective = 100; TweenMax.staggerFrom($shows, 0.4, {opacity:0, rotationX:-90, delay:1}, 0.4);The CSSPlugin.defaultTransformPerspective property must be set before any 3D transforms execute to take effect.
Understanding perspective values is crucial for professional 3D animation. Lower values (like our 100) simulate being very close to the animated elements, creating dramatic distortion. Higher values represent greater camera distance with subtler effects.
For element-specific perspective (when you need different 3D intensity for different animations), you could alternatively use:
TweenLite.set($shows, {transformPerspective:100});(Don't add this code—it's provided for reference only.)
Preview the dramatic 3D effect. While impressive, the extreme distortion at value 100 may distract from the content rather than enhance it.
Adjust to a more practical perspective value:
CSSPlugin.defaultTransformPerspective = 600;Values between 600-800 typically provide the sweet spot for interface animations—noticeable 3D depth without overwhelming distortion. This range creates professional-looking effects that enhance rather than dominate the user experience.
Preview the refined animation. The 3D rotation now feels purposeful and polished, adding visual interest while maintaining readability and usability.
3D transforms require perspective to create realistic depth effects. Without transformPerspective, rotationX appears as simple vertical stretching.
Perspective Values and Visual Impact
Using TransformOrigin in a 3D Tween
Transform origin controls the anchor point around which rotations and other transforms occur. By default, elements rotate around their center point, but strategic origin positioning can dramatically improve animation realism and visual appeal.
Modify the rotation anchor point to simulate natural hinge behavior:
TweenMax.staggerFrom($shows, 0.4, {opacity:0, rotationX:-90, transformOrigin:"center top", delay:1}, 0.4);The "center top" value maintains horizontal centering while moving the rotation axis to each element's top edge—like pages flipping down from a hinge.
Save and preview the final animation. Each show card now appears to swing down naturally from its top edge, creating intuitive motion that mirrors real-world physics.
NOTE: For browsers lacking 3D transform support (primarily Internet Explorer 9 and earlier), the 3D properties are gracefully ignored while opacity animations continue functioning. This progressive enhancement approach ensures your animations work across all user environments.
Transform Origin Options
Center Center (Default)
Elements rotate around their center point, creating a flip-in-place effect suitable for cards or panels.
Center Top
Elements swing down from their top edge, mimicking natural hinge movement like opening doors or flaps.
Center Bottom
Elements flip up from their bottom edge, creating upward reveal animations for content blocks.
TweenMax's Other Staggering Methods
TweenMax also provides staggerTo() and staggerFromTo() methods for different animation scenarios. The staggerTo() method animates elements to specific end states, while staggerFromTo() offers complete control over both starting and ending values. Explore comprehensive documentation and advanced techniques at greensock.com/docs/TweenMax
TweenMax Stagger Methods
| Feature | staggerFrom() | staggerTo() | staggerFromTo() |
|---|---|---|---|
| Animation Direction | From start state | To end state | From start to end |
| Initial Values | Defines start | Uses current | Defines both |
| Use Case | Entrance effects | Exit animations | Complete transitions |
In IE 9 and lower, 3D animations are ignored but opacity and 2D transforms still function, ensuring graceful degradation.