0%
Lesson 13 · ScrollTrigger

Scroll to
tell a story.

Scroll down to see four different ScrollTrigger patterns in action: stagger fade-in, parallax, pinned storytelling, and a progress counter.

Elements reveal
as you scroll past.

Six cards fade in from below with a 0.1s stagger when the grid enters the viewport at start: 'top 75%'.

01
Viewport trigger
Fires once when the element scrolls into view.
02
start: 'top 75%'
Trigger when top of element hits 75% from viewport top.
03
stagger: 0.1
Each card starts 0.1s after the previous one.
04
ease: power2.out
Decelerates into final position for a natural feel.
05
Once only
No toggleActions means it plays once and stays.
06
Batch-select
One gsap.from() call targets all matching elements.

Background and
text move at
different speeds.

The heading drifts upward at y: -80 tied to scroll via scrub: 1. Scrolling up reverses it.

1 / 3

Pin a section
in place.

The section stays fixed on screen while you scroll. Scroll distance becomes animation progress.

2 / 3

Text swaps
as you scrub.

Three panels fade in and out in sequence. The timeline is driven entirely by scroll position.

3 / 3

Scroll storytelling
made simple.

One GSAP timeline with pin: true and scrub: 1 handles all of this.

Scroll to count.

The number below reads self.progress inside onUpdate and reflects it as a percentage.

0%

Keep scrolling ↓