ScrollMagic uses two primary mental models for tracking, determined by how the container bounds are positioned relative to the element:
Contain
Default when element is null.
Container bounds match the viewport edges (containerStart and containerEnd are both at 'here' / 0%). Progress tracks while one fully contains the other (e.g., the element is fully inside the viewport, or the element fully covers the viewport).
Typical uses: scroll progress bars, parallax, scroll-linked video.
Intersect
Default when element is set.
Container bounds span the full viewport (containerStart and containerEnd are at 'opposite' edges / 100%). Progress tracks while the element intersects with the viewport (from the moment its leading edge enters until its trailing edge leaves).
Typical uses: enter/leave animations, lazy loading, visibility tracking.
Mapping to CSS Scroll-Driven Animations
If you are familiar with native CSS view() timelines, here is the mapping:
| Native range | ScrollMagic equivalent |
|---|
cover | intersect default — containerStart: 'opposite', containerEnd: 'opposite' |
contain | contain default — containerStart: 0, containerEnd: 0 |
entry | containerStart: 'opposite', containerEnd: 0 |
exit | containerStart: 0, containerEnd: 'opposite' |