Marcus Andrey Study
Ler em português Library

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

EffectWho controls the speedRiskWith reduced motion
Reading progress barThe reader, exactlyLow: small, at the edge, carries informationKeep it
Sticky header that shrinksThe readerLow, if the content under it doesn't jumpSwap sizes without the in-between
Reveal on enter (fade, short rise)The readerMedium: content hidden until it moves; slow if overdoneContent simply visible
Scroll snapping in a carouselThe reader, then the browser settles itLow to medium: can fight a slow, careful scrollKeep it; no extra animation needed
Parallax backgroundsThe reader, but layers move at other speedsHigh: a known trigger for vestibular symptoms, and often hurts readingEverything moves together, or not at all
Scrolljacking (pinned scenes, changed scroll speed)The pageHigh: takes control away; people lose their placeDon't ship it in the first place
Scroll effects, from safest to riskiest. The line that matters is the second column: when the reader's own hand sets the speed, motion explains; when the page takes over, motion gets in the way.Table: Marcus Andrey, CC BY 4.0. Sources: NN/g, Scrolljacking 101 (2023) and What Parallax Lacks (2019); W3C, Understanding 2.3.3 Animation from Interactions.

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.

1. The bar is a scroll timeline
2. Each card has a view timeline
3. Scroll back up: it runs backwards
4. Stop scrolling: it stops too
5. Reduced motion: the cards are just there
6. Old browser: the cards are just there

The end. The bar is full.

Two scroll-driven animations, in CSS only. The reading bar is tied to how far the box has scrolled; each card's rise is tied to its own trip into view. Nothing plays on a clock: the scroll is the playhead, so the person scrolling is always in control. If you prefer reduced motion, or your browser doesn't support scroll timelines, the cards don't move at all.Live CSS: 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, and animation-range says 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-timeline comes after animation. The animation shorthand resets the timeline to auto, 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.
  • @supports protects 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 @supports and prefers-reduced-motion wrappers 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-timeline before the animation shorthand.
  • 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)

  1. Open three long marketing pages you like.
  2. Scroll each one slowly, then fast, then with the keyboard (Space and arrows).
  3. 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

Books, courses and videos to go deeper

Vestibular disorders and reduced motion · CSS transitions and animations · Gestures and direct manipulation · Motion performance · Audit a page for reduced motion

Saved only on this device.

↑ ↓ to move · Enter to open · Esc to close