• Motion & 3D
  • gsap
  • scrolltrigger

Published24 JUL 26.

Share

ScrollTrigger without the jank

Most ScrollTrigger jank is architectural — what you pin and when you refresh — not a tuning problem.

Scroll-driven animations are the hallmark of high-end Awwwards-caliber digital experiences. When executed well, they draw readers into compelling editorial stories. When implemented poorly, they introduce violent scroll stutter, layout jumping, and high CPU spikes. In our engineering practice, we established strict architectural rules to ensure GSAP ScrollTrigger runs at a flawless 120 FPS across all devices.

01/ 08

The hidden layout cost of GSAP automatic pin spacers

When you pass `pin: true` to GSAP ScrollTrigger, the library physically detaches your DOM element, wraps it inside an absolute `.pin-spacer` container, and injects it back into the page. This DOM manipulation triggers massive browser layout reflows.

Worse, whenever webfonts load or the window resizes, `ScrollTrigger.refresh()` recalculates every pin spacer from scratch, causing visible jumps in scroll position.

Pin spacers break natural document flow and make responsive resizing brittle and unpredictable.

Don't let a JavaScript library manipulate your DOM tree layout when CSS position sticky does it natively on the compositor.

The hidden layout cost of GSAP automatic pin spacers

02/ 08

Native CSS position: sticky with GSAP scrub triggers

The modern architectural solution is simple: handle the physical pinning entirely in CSS using `position: sticky; top: 0;` inside a taller parent `.scroll-track` container.

ScrollTrigger is then configured with `pin: false` and simply tracks the scrub progress across the parent container: `trigger: '.scroll-track', start: 'top top', end: 'bottom bottom', scrub: true`.

Zero DOM elements are moved, zero reflows occur, and the browser compositor handles the sticky hold with native hardware acceleration.

This separates layout responsibilities cleanly: CSS manages document geometry while GSAP strictly computes animation progress.

03/ 08

Eliminating start and end calculation drift

ScrollTrigger computes its trigger coordinates by measuring DOM element heights. If measurements occur before webfonts finish loading or images resolve, the start and end trigger points will be completely inaccurate.

We wrap `ScrollTrigger.refresh()` inside `document.fonts.ready` promises and window `load` listeners, ensuring every animation trigger binds to the exact final rendered geometry.

Synchronizing refresh calls with asset loading prevents animations from firing prematurely.

04/ 08

Restricting scroll tweens strictly to transform and opacity

Never animate properties that trigger layout or paint inside a scroll scrub: `top`, `left`, `width`, `height`, `margin`, or `padding` are strictly forbidden.

All scroll-linked choreography must animate `transform: translate3d(...)`, `scale()`, `rotate()`, and `opacity`. Adding `will-change: transform` isolates the element into its own dedicated GPU layer, guaranteeing silky smooth rendering.

Restricting mutations to compositor properties guarantees frame times well below the 16ms threshold.

05/ 08

Profiling frame timelines for 120 FPS perfection

We profile every scroll-driven page in Chrome DevTools Performance panel under 4x CPU throttling. If a scroll frame exceeds 8ms of execution time, we isolate and refactor the tween until the frame budget is fully satisfied.

Meticulous profiling guarantees that low-power devices maintain consistent frame rates during long scrolling sessions.

06/ 08

Layer promotion strategies and GPU memory limits

Promoting elements to hardware-accelerated layers using `will-change: transform` or `transform: translateZ(0)` is essential for 120 FPS scrolling, but overusing layer promotion can exhaust GPU VRAM on mobile devices.

We apply `will-change` selectively only to elements actively undergoing scroll-linked transforms, and remove the property when animations complete or elements exit the viewport.

Prudent GPU memory management guarantees smooth performance across long editorial articles.

Keeping VRAM usage tight prevents the browser compositor from crashing on memory-constrained mobile phones.

Selective layer management balances rendering fluidity with device memory constraints.

Profiling GPU memory usage in Chrome DevTools ensures that layer allocations remain within safe thresholds across extended user sessions.

07/ 08

Tailoring ScrollTrigger behaviors for touch viewports

On mobile devices, vertical screen space is precious. Complex multi-stage scroll pins that work well on 27-inch desktop monitors can trap mobile users in endless scrolling loops.

We simplify or bypass heavy scroll scrubbing on mobile viewports using media queries, allowing touch users to glide through content quickly without disruptive pinned scroll traps.

Designing responsive motion means adapting choreography to fit device interaction contexts.

Mobile experiences should focus on clean vertical readability rather than disorienting scroll-jacking.

Responsive animation design treats desktop and mobile as distinct physical interaction contexts.

Prioritizing readability on mobile screens builds user trust while preserving desktop creative flair.

08/ 08

Automated frame budget validation in CI

We run automated performance benchmarks in our continuous integration pipeline using Lighthouse and Chrome tracing to verify that scroll-driven pages never exceed 8ms per frame under CPU throttling.

Catching layout regressions before code merges into production guarantees that our digital flagships run silky smooth on every visitor's hardware.

Continuous performance benchmarking protects scroll fluidity from unintended regressions.

Automated frame tracing keeps motion code within strict performance budgets.

Continuous integration safeguards ensure that animation additions never degrade runtime frame rates.

Before you ask.

01Why does GSAP ScrollTrigger stutter on pinned sections?
Automatic pin spacers manipulate the DOM structure during scroll, causing expensive layout reflows. Using native CSS position: sticky solves this completely.
02Which CSS properties are safe to animate with ScrollTrigger?
Only hardware-accelerated compositor properties: transform (translate, scale, rotate) and opacity. Never animate margins, padding, or width.

Most ScrollTrigger jank is architectural — what you pin and when you refresh — not a tuning problem.

01 / 08The hidden layout cost of GSAP automatic pin spacers

Close