Skip to content
IndexRequest a UIAboutContact

Marquee Ticker with Pause

Two rows scroll in opposite directions; hover or Pause stops them, and reduced motion shows a static list.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Build a two-row marquee of keyword pills (Motion, Layout, Typography, Colour, Depth, Light, Texture, Rhythm). The top row scrolls left at a slow constant speed (24 seconds per loop), the bottom row scrolls right (32 seconds). Duplicate each track for a seamless loop and mark the copy aria-hidden. Soft white fades on both edges. Pause on hover and focus-within, and provide a visible Pause/Play button with aria-pressed. Under prefers-reduced-motion stop all scrolling, wrap the pills into a static list and hide the button. Light minimal style, pills with 1 pixel border and 13 pixel text. Plain HTML, CSS and JavaScript (only for building the tracks and the button).

About this pattern

Definition

A marquee is content that scrolls continuously in a loop, often used for logo strips, keywords and announcements. The row is duplicated so the loop restarts without a visible jump.

Purpose & UX principles

  • Good for decorative, repeated content (client logos, topics); do not use it for essential information.
  • Moving content that lasts more than five seconds needs a pause control (WCAG 2.2.2), and it should also pause on hover and focus.
  • Duplicate the items for the loop and hide the copy from screen readers.

Interaction states

  • Running, paused by hover, paused by button, reduced motion (static wrapping list).

Motion specification

  • Linear translateX loop, 24s per cycle for the top row and 32s reverse for the bottom row.
  • Reduced motion: no scrolling; items wrap in a static list and the pause button is hidden.

Responsive behaviour

  • Speed is set in pixels per second, so very wide screens still look calm; edge fades soften the cut.
  • Keep item height consistent and gaps equal.

Code

HTML
<div class="bx"><div class="mq" id="mq"></div><button id="pz" type="button" aria-pressed="false">Pause</button></div>

Related patterns

Pointer Parallax Layers

↗
Pointer Parallax LayersMotion & Transitions

Rotating Text Swap

↗
Rotating Text SwapMotion & Transitions

Scroll Reveal

↗
Scroll RevealMotion & Transitions