Motion and Interaction · Step 4 · 7 min read
Scroll and motion
Scrolling is the movement people make most, and the one they expect to own. Which scroll effects help (a reading bar, a short reveal, snapping), which ones hurt (parallax, scrolljacking), and how CSS scroll-driven animations tie motion to the scroll itself, with reduced motion built in.
Scrolling belongs to the reader. Their finger or wheel sets the speed, and the page is supposed to follow, nothing more. Motion tied to scroll can help, like a bar that shows how far you've read. It can also take the wheel away, with scenes that pin, layers that slide at other speeds and pages that scroll slower than your hand. The test is simple: who controls the speed?
What you'll be able to do after reading:
- Sort scroll effects from safe to risky, and say why
- Explain why parallax and scrolljacking cause problems
- Build a reading bar and a reveal with CSS scroll-driven animations
- Make scroll effects respect reduced motion and old browsers
1. Who controls the speed
| Effect | Who controls the speed | Risk | With reduced motion |
|---|---|---|---|
| Reading progress bar | The reader, exactly | Low: small, at the edge, carries information | Keep it |
| Sticky header that shrinks | The reader | Low, if the content under it doesn't jump | Swap sizes without the in-between |
| Reveal on enter (fade, short rise) | The reader | Medium: content hidden until it moves; slow if overdone | Content simply visible |
| Scroll snapping in a carousel | The reader, then the browser settles it | Low to medium: can fight a slow, careful scroll | Keep it; no extra animation needed |
| Parallax backgrounds | The reader, but layers move at other speeds | High: a known trigger for vestibular symptoms, and often hurts reading | Everything moves together, or not at all |
| Scrolljacking (pinned scenes, changed scroll speed) | The page | High: takes control away; people lose their place | Don't ship it in the first place |
Everything in the table is one question. When the reader's hand sets the speed and the motion stays small, it explains. When the page changes the speed or direction, it gets in the way.
- Scrolljacking changes "the speed and, sometimes, the direction of scrolling". In NN/g's usability testing, sites with it showed "significant threats to user control and freedom, discoverability, attention, efficiency, and task success" (NN/g, Scrolljacking 101, 2023).
- Parallax moves layers at different speeds to fake depth. NN/g's tests found it often brings slow loading, hard reading and unimpressed users (NN/g, What Parallax Lacks, 2019). It's also a known problem for people with vestibular disorders: WCAG names parallax scrolling as a typical non-essential animation, and warns that elements moving while you scroll, other than the scrolling itself, can trigger dizziness, nausea and headaches (W3C, Understanding 2.3.3).
2. Scroll as the playhead
Scroll down inside this box. The thin bar at the top fills as you read, and each card rises into place as it enters the box.
The end. The bar is full.
animation-timeline: scroll() and view(), animation-range, inside @supports and prefers-reduced-motion. Demo: Marcus Andrey, CC BY 4.0.Scroll inside the box. Nothing in it runs on a clock. With CSS scroll-driven animations, an animation's progress is tied to a scroll position instead of to time: scroll forward and it plays, scroll back and it rewinds, stop and it stops (MDN, CSS scroll-driven animations). There are two kinds of timeline:
- Scroll progress timeline,
animation-timeline: scroll(): progress from the top to the bottom of a scroller. The reading bar uses it. - View progress timeline,
animation-timeline: view(): progress of one element through the visible part of its scroller (MDN, view()). Each card uses its own, andanimation-rangesays which part of that trip to use (MDN, animation-range).
Because the scroll is the playhead, these keep the reader in charge, which is exactly what scrolljacking doesn't. They also run off the main thread, so they stay in step with the scroll instead of lagging behind it (Chrome for Developers, Scroll-driven animations).
3. The code that runs
These are the rules from the figure, as they run:
@supports (animation-timeline: scroll()) {
.mo-b-scroller__bar { animation: mo-b-grow linear both; animation-timeline: scroll(); }
}
@supports (animation-timeline: view()) {
@media (prefers-reduced-motion: no-preference) {
.mo-b-reveal { animation: mo-b-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
}
}
@keyframes mo-b-grow { to { transform: scaleX(1); } }
@keyframes mo-b-rise { from { opacity: 0; transform: translateY(1.5rem); } }
Four details:
animation-timelinecomes afteranimation. Theanimationshorthand resets the timeline toauto, so writing them the other way round silently brings back the clock (MDN, animation-timeline).- The reveal is opt-in. It only exists inside
prefers-reduced-motion: no-preference. For everyone else the cards are simply there, which is also the version that can never hide content by mistake. - The bar stays under reduced motion. It's small, at the edge, moves only as far as the reader's own scroll, and carries information. That's a judgement call; if your bar is large or colourful, drop it too.
@supportsprotects old browsers. Scroll-driven animations shipped in Chrome 115, Safari 26 and Firefox 159 (MDN browser compatibility data). Anywhere else the cards are visible and the bar is hidden, with nothing broken.
Keep reveals short: a 1.5rem rise and a fade, finished by the time the card is fully in view (entry 100%). Long distances, rotations and zooms on scroll are the kind of motion that WCAG 2.3.3 asks you to let people turn off (W3C, Understanding 2.3.3).
4. Scroll snapping and other native help
Not all scroll motion needs animation. CSS scroll snapping makes a carousel or a gallery settle on each item after the reader lets go (MDN, CSS scroll snap); overscroll-behavior stops a scroll inside a panel from dragging the whole page along (MDN, overscroll-behavior). The previous step used both in Gestures and direct manipulation. Use mandatory snapping only for small, item-sized scrollers; in a long page it fights readers who scroll slowly.
5. When the content waits for the scroll
A reveal hides content until it moves. That has three risks worth testing:
- Jumps to a heading or a search result can land on a spot that still looks empty if the reveal is slow.
- Fast scrolling shows a page of half-faded cards. Keep the range short so cards finish arriving early.
- Nothing to see without motion. If the reveal fails, the content must still be there. The
@supportsandprefers-reduced-motionwrappers above give you that for free.
If a section only works with its scroll animation, it's a film, not a page. Make it a video with controls instead.
6. Common mistakes
- Pinned "scroll stories" that change scroll speed and trap people for several screens.
- Parallax backgrounds with no reduced-motion version.
- Writing
animation-timelinebefore theanimationshorthand. - Reveals on every paragraph, so reading becomes waiting.
- Content that stays invisible when the browser doesn't support the effect.
7. Vocabulary
| Term | Meaning |
|---|---|
| Scroll-driven animation | An animation whose progress follows a scroll position instead of time |
| Scroll progress timeline | Progress through a scroller from start to end: scroll() |
| View progress timeline | Progress of one element through the visible area: view() |
animation-range |
Which part of a timeline the animation uses, like entry 0% entry 100% |
| Parallax | Layers moving at different speeds while you scroll, to suggest depth |
| Scrolljacking | A page changing the speed or direction of your scroll |
8. Try it (no tools needed)
- Open three long marketing pages you like.
- Scroll each one slowly, then fast, then with the keyboard (Space and arrows).
- Note every moment the page moves at a different speed from your hand.
Reflection questions: Which effect would you keep if you had to keep only one? Would the page lose any information with all the scroll effects off?
9. If you already practise
- Add a scroll rule to your motion guidelines: effects follow the reader's speed; no pinning, no changed scroll speed, no parallax without a reduced-motion version.
- Build reveals with scroll timelines and
@supports, not scroll event listeners. - Review long pages with the system's reduced-motion setting on, every time.
Checklist
Learn more
- MDN: CSS scroll-driven animations · animation-timeline · view() · animation-range · prefers-reduced-motion
- Bramus, Animate elements on scroll with Scroll-driven animations (Chrome for Developers, 2023)
- Sara Paul, Scrolljacking 101 (NN/g, 2023) · Katie Sherwin, What Parallax Lacks (NN/g, 2019)
- W3C, Understanding 2.3.3 Animation from Interactions
Books, courses and videos to go deeper
Related
Vestibular disorders and reduced motion · CSS transitions and animations · Gestures and direct manipulation · Motion performance · Audit a page for reduced motion