Fancy Rollovers with TimelineLite
Master Interactive Animations with GreenSock TimelineLite
Core Animation Concepts
TimelineLite
Powerful sequencing tool for creating complex animations with precise timing control and interactive behavior.
CSS Clip Property
Defines visible rectangles within elements, enabling sophisticated reveal animations from specific directions.
Mouse Events
Mouseenter and mouseleave events trigger animation playback and reversal for responsive user interactions.
Animation Sequence Breakdown
Map Reveal
Map panel flies up using CSS clip property animation
Pin Drop
Location pins animate down with staggered timing
Content Fade
Body copy dims while form input slides up simultaneously
Analyze the coordinates in your clip value. Setting both top and bottom values to 204px creates a zero-height visible area at the panel's bottom edge—our starting point for the reveal animation.
Save and reload your browser. The reveal animation now works beautifully!
You might wonder why only specifying the from() values creates a complete animation. The answer lies in our CSS file, where we've pre-defined the final clip state. Let's examine this setup.
Open TimelineLite RollOvers > css > main.css in your code editor.
Locate the following CSS rule around lines 118–126:
#mapPanel {
position:absolute;
background-color:#b8d7ea;
width:287px;
height:204px;
top:-204px;
/* top / right / bottom / left */
clip:rect(0px 287px 204px 0px);
}
The highlighted clip property defines the panel's final visible state. When our from() tween executes, GreenSock automatically interpolates between the specified starting values and these CSS end values, creating a smooth bottom-to-top reveal effect.
Return to editing start.html to synchronize the animations.
Currently, the button color change and map reveal happen sequentially. For a more dynamic, professional feel, let's make them simultaneous by using timeline positioning.
Add a position parameter to synchronize the animations:
.from($mapPanel, 0.5, {clip:"rect(204px 287px 204px 0px)"}, 0)
The position parameter 0 instructs this tween to start at the timeline's beginning, making it concurrent with the button color change.
Save and reload your browser.
The synchronized timing creates a more cohesive, polished interaction that feels immediate and responsive—exactly what users expect from modern interfaces.
Key Takeaways

