Last updated: 5 December 2026
If your GSAP and Lenis site looks perfect in Chrome but jumps, jitters or breaks its headings on an iPhone, the cause is usually one of six things. The Safari address bar resizes the viewport. 100vh is taller than the screen. SplitText runs before your fonts load. Two animation loops fight each other. Pinned sections lag behind iOS momentum scrolling. Or there are simply too many split elements. Here's how each one showed up on my portfolio, and the code that fixed it.
At a glance
| # | Symptom on iPhone | Cause | Fix |
|---|---|---|---|
| 1 | Page jumps or animations restart when the address bar hides | The viewport resize triggers ScrollTrigger.refresh() | ScrollTrigger.config({ ignoreMobileResize: true }) |
| 2 | Hero is cut off at the bottom, or resizes while you scroll | 100vh is the large viewport; dvh moves with the bar | 100svh for heroes and pinned sections |
| 3 | Split lines break in odd places or words overflow | SplitText measured lines with the fallback font | autoSplit: true with onSplit() |
| 4 | Scrubbed animations trail or stutter with Lenis | Lenis and GSAP run separate frame loops | Drive Lenis from gsap.ticker |
| 5 | Pinned sections jump during fast momentum scroll | The pin switches a frame late on iOS | anticipatePin: 1; normalizeScroll() as a last resort |
| 6 | Choppy text reveals on older iPhones | Hundreds of split character elements | Lines for body text, chars only for short headings |
First, make the bugs visible
You can't fix what you can't see on the phone. I keep a small overlay in the repo that only loads with ?debug in the URL. It shows the viewport height, how often ScrollTrigger refreshes, and the frame rate.
if (new URLSearchParams(location.search).has('debug')) {
const box = document.createElement('pre');
box.style.cssText = 'position:fixed;left:8px;bottom:8px;z-index:99999;margin:0;padding:8px;' +
'font:11px/1.4 ui-monospace,monospace;background:rgba(0,0,0,.8);color:#7CFC8A;pointer-events:none';
document.body.append(box);
let refreshes = 0, frames = 0, fps = 0, last = performance.now();
ScrollTrigger.addEventListener('refresh', () => refreshes++);
gsap.ticker.add(() => {
frames++;
const now = performance.now();
if (now - last >= 1000) { fps = frames; frames = 0; last = now; }
box.textContent =
`innerHeight ${innerHeight}\n` +
`visualViewport ${Math.round(window.visualViewport?.height ?? 0)}\n` +
`scrollY ${Math.round(scrollY)}\n` +
`ST refreshes ${refreshes}\n` +
`fps ${fps}`;
});
}Two more habits help. Connect the iPhone to a Mac and use Safari's Web Inspector (turn it on in the iPhone's Settings → Safari → Advanced). And test once with Low Power Mode on: it throttles the frame rate and exposes jank you'll never see on a charging phone.
1. The address bar resize restarts your ScrollTriggers
On iOS Safari the address bar shows and hides as you scroll. That changes the viewport height, so the browser fires resize. ScrollTrigger listens for resizes and calls refresh() to recalculate every start and end position. A recalculation in the middle of a scroll looks like a jump.
ScrollTrigger.config({ ignoreMobileResize: true });This tells ScrollTrigger to skip the refresh when a touch device's viewport changes height by less than about 25%, which covers the address bar. The trade-off: start and end positions stay calculated for one viewport height. For reveal animations that's invisible. For pinned layouts that must line up exactly, test with the bar both shown and hidden.
2. 100vh is taller than the screen
In iOS Safari, 100vh is the large viewport: the height with the address bar hidden. On page load the bar is visible, so a 100vh hero is cut off at the bottom. 100dvh follows the bar, but it changes as you scroll, which moves everything sized with it.
.hero {
min-height: 100vh; /* fallback for older browsers */
min-height: 100svh; /* small viewport: never changes while scrolling */
}
.pin-section {
height: 100vh;
height: 100svh;
}Use svh for anything ScrollTrigger measures. Keep dvh for things that should follow the bar, like a full-screen menu overlay.
3. SplitText splits lines before your font loads
SplitText measures where lines wrap at the moment it runs. If your web font hasn't loaded yet, it measures the fallback font. When the real font swaps in, the text gets wider or narrower, but the line elements stay where they were split. You get words spilling over or lines broken mid-phrase. On mobile data this happens far more often than on your desktop, and rotating the phone does the same thing.
Since GSAP 3.13, SplitText can re-split by itself:
document.querySelectorAll('.reveal-heading').forEach((heading) => {
SplitText.create(heading, {
type: 'lines',
mask: 'lines',
autoSplit: true,
onSplit: (self) =>
gsap.from(self.lines, {
yPercent: 110,
duration: 0.9,
ease: 'expo.out',
stagger: 0.08,
scrollTrigger: { trigger: heading, start: 'top 85%' },
}),
});
});autoSplit re-splits when fonts finish loading or the element resizes. Create the animation inside onSplit() and return it. SplitText then cleans up the old animation and keeps the new one in sync on every re-split. On an older GSAP version, run the split inside document.fonts.ready.then(…) and re-split on resize yourself. Since 3.13, all GSAP plugins including SplitText are free, so upgrading is the easier route.
One caution: don't hide your H1 with CSS while waiting for the split. Keep above-the-fold text visible from the first paint and animate headings further down the page.
4. Lenis and GSAP run two animation loops
Lenis needs lenis.raf() called every frame, and GSAP has its own ticker. If Lenis runs its own loop (autoRaf: true, or your own requestAnimationFrame) while ScrollTrigger updates on GSAP's ticker, they can read the scroll position at different points in a frame. Scrubbed animations then trail the scroll or stutter. GSAP's lag smoothing adds to it: after a dropped frame it adjusts time, so Lenis falls further behind.
The fix is the integration from the Lenis README. One loop drives both:
const lenis = new Lenis(); // no autoRaf: GSAP's ticker drives it
lenis.on('scroll', ScrollTrigger.update);
gsap.ticker.add((time) => lenis.raf(time * 1000)); // ticker time is in seconds, Lenis wants ms
gsap.ticker.lagSmoothing(0);5. Pinned sections jump during momentum scrolling
iOS scrolls on its own thread, and JavaScript hears about the scroll position slightly late. When a pin starts, ScrollTrigger switches the element to position: fixed. During a fast flick that switch can land a frame late, and the section visibly jumps.
Try the fixes in this order:
- Add
anticipatePin: 1to pinned ScrollTriggers. It applies the pin slightly early, which hides the late frame. - Keep Lenis's
syncTouchoff (the default), so the iPhone uses native touch scrolling. The Lenis README warns thatsyncTouchcan be unstable on iOS versions before 16. - As a last resort,
ScrollTrigger.normalizeScroll(true)moves scrolling onto the JavaScript thread. It changes how scrolling feels, and GSAP's own docs list iOS cases it can't fully fix. I wouldn't run it together with Lenis on a touch device, because both try to take control of scrolling.
if (ScrollTrigger.isTouch === 1) {
// touch-only device: native scrolling; enable only if pins still jump
// ScrollTrigger.normalizeScroll(true);
} else {
startLenis(); // smooth wheel scrolling on desktop
}6. Too many split elements for an older iPhone
Splitting a 400-character paragraph by chars creates 400 elements, each with its own animated transform, plus word and line wrappers. Newer iPhones cope. Older ones, or any iPhone in Low Power Mode, drop frames.
- Split paragraphs by
lines, subheadings bywords, and usecharsonly for short display headings. - Use SplitText's
maskoption instead of hand-written overflow wrappers. - Animate only
transformand opacity (yPercent,autoAlpha). Avoid animatingfilter: blur()orletter-spacingacross many elements.
Two accessibility traps
- Split text and screen readers. Since 3.13, SplitText's default
aria: "auto"adds anaria-labelwith the text to the split element and hides the line, word and character pieces from screen readers. That means the sentence is read once, not letter by letter. But the label holds only text, so a link inside a split element stops working for screen-reader users. Don't split an element that contains a link; split a<span>inside it instead. - Reduced motion. Put all of this inside
gsap.matchMedia(), so people who turn on Reduce Motion get a static page and native scrolling.
The final setup
All six fixes together. This is close to what runs on my site now.
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
import { SplitText } from 'gsap/SplitText';
import Lenis from 'lenis';
gsap.registerPlugin(ScrollTrigger, SplitText);
// 1. Don't recalculate every time the iOS address bar moves
ScrollTrigger.config({ ignoreMobileResize: true });
const mm = gsap.matchMedia();
mm.add('(prefers-reduced-motion: no-preference)', () => {
// 4. Smooth wheel scrolling on desktop only, driven by GSAP's ticker
let lenis;
let tick;
if (ScrollTrigger.isTouch !== 1) {
lenis = new Lenis();
lenis.on('scroll', ScrollTrigger.update);
tick = (time) => lenis.raf(time * 1000);
gsap.ticker.add(tick);
gsap.ticker.lagSmoothing(0);
}
// 3 + 6. Line reveals that re-split after fonts load or on resize
document.querySelectorAll('.reveal-heading').forEach((heading) => {
SplitText.create(heading, {
type: 'lines',
mask: 'lines',
autoSplit: true,
onSplit: (self) =>
gsap.from(self.lines, {
yPercent: 110,
duration: 0.9,
ease: 'expo.out',
stagger: 0.08,
scrollTrigger: { trigger: heading, start: 'top 85%' },
}),
});
});
// 5. Pin slightly early to hide the late frame on iOS
gsap.to('.work-track', {
xPercent: -50,
ease: 'none',
scrollTrigger: { trigger: '.work', pin: true, scrub: true, anticipatePin: 1 },
});
return () => {
if (tick) gsap.ticker.remove(tick);
lenis?.destroy();
};
});And in your CSS, size the hero and pinned sections with 100svh (fix 2).
What I'd do differently
Test on a real iPhone from the first day, not after the desktop version feels finished. Keep the debug overlay in the repo behind ?debug, and run one pass with Low Power Mode on before every release.
If you've hit an iOS Safari bug that isn't on this list, tell me in the comments. I'll add it with credit.

