GalleryPremium

Hover Pause

A line of amber words that stops as soon as the mouse rests on it, and shows it: every word grows by 10% for as long as the pause lasts.

CSSJSInteractive

Updated

This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Gallery has 44 effects, including 6 free. Explore the category →

3 usage examples

“Find the odd one out” — mini-game on the kids' page of a natural history museum — Hover Pause example 1

① “Find the odd one out” — mini-game on the kids' page of a natural history museum

WhenIn the kids' corner of the Muséum de Sarlavèze, the question “Who does not lay eggs?” sits above a band where six animals go by as big buttons: the turtle, the penguin, the bat, the frog, the crocodile, the hen.
WhyThe difficulty of the game is the band rushing past; the rule is the effect: resting the mouse stops it and enlarges the words, and then you can aim. The clicked button turns green or red and a sentence explains why: that part is written by the page, not by the effect.
Settingsdata-speed="95", --hpmq-zoom: 1.1, --hpmq-space: 0px, --hpmq-size: 17px, --hpmq-bg: transparent, --hpmq-height: auto; a <button> in each <li>, and 13 px of padding on each side of the <li> instead of the gap (the cells touch, no click falls in between); 16 px of padding above and below .hpmq-viewport to enlarge the area that stops the band.
“Did you know?” — facts to read on a public aquarium's page — Hover Pause example 2

② “Did you know?” — facts to read on a public aquarium's page

WhenUnder the menu of the Aquarium de Port-Marvelle, five small cards pass slowly: the octopus and its three hearts, the male seahorse that carries the eggs, the starfish whose arm grows back. Further down, the jellyfish tank and its times stay fixed.
WhyA two-line card cannot be read on the move. Resting the mouse on it freezes the row and brings it a little closer (6%), long enough to read; take it away and the next one arrives. The growth is deliberately small: the cards are wide, a stronger zoom would make them touch.
Settingsdata-speed="46", --hpmq-zoom: 1.06, --hpmq-space: 22px, --hpmq-size: 11.5px; each <li> becomes a 196 px card with white-space: normal; 7 px of padding on .hpmq-viewport so the enlarged card is not cut off.
Official festival hashtags to copy — bottom bar of the “Share” page — Hover Pause example 3

③ Official festival hashtags to copy — bottom bar of the “Share” page

WhenOn the “Share” page of Lueurs d'Orvède, under the invitation to post your photos, a bar runs through the five official hashtags. You stop it, click “#GrandeScene”: it turns yellow and the line below confirms “Copied”.
WhyClicking a moving target is tiresome; here the band stops before the click, and the growth confirms it is waiting. Copying to the clipboard takes a few lines of script that belong to the page.
Settingsdata-speed="70", --hpmq-zoom: 1.1, --hpmq-space: 0px, --hpmq-size: 13px, --hpmq-button-size: 26px; one <button> per hashtag, 12 px of padding on each side of the <li>; 11 px of padding on .hpmq-viewport.

How it works

At rest, the line glides left at 80 px per second (data-speed). As soon as the mouse enters .hpmq-viewport, two things happen together: the animation pauses right where it is, and each <li> grows by 10% in 0.3 seconds (transform: scale, set by --hpmq-zoom). The mouse leaves: the words go back to their size and the line restarts from where it had stopped.

That growth is the signal that the line is “held”: you can read, aim at a word, click. It affects all the words at once, not only the one under the pointer. It also happens with the keyboard: when a link or a button in the band takes focus, the line goes back to its start, holds still and grows the same way.

The round button stops the line without enlarging it: that is a lasting pause, for someone who wants no more motion, whereas hovering is a reading pause. Since the words grow in place, leave a gap between them (--hpmq-space) wider than what they gain: 10% of the width of the longest one.

Accessibility

  • Two ways to stop: hovering (mouse) and the Pause button with aria-pressed (mouse, finger, Tab then Space or Enter). Only the button is dependable on a touch screen: see the question about phones.
  • Keyboard focus: a link or a <button> placed in an <li> is reached with Tab, in the original list only. Its 2 px outline is drawn inset, at a distance worked out from the zoom, so it stays whole once the word is enlarged. A mouse click does not move anything: the line stays under the pointer and the click is not lost.
  • Zoom and legibility: the growth helps reading a stopped word; it does not replace a text size that is large enough at rest.
  • If the user limits animations: the line does not scroll and is explored by hand. Hovering still enlarges the words, at once, with no transition.
  • Contrast: amber #fbbf24 on #0a0a0f, 11.8:1.

Browser compatibility

animation-play-state: paused and transform: scale() driven by :hover, plus 5 KB of script to fill the line; no dependency. The inset focus outline relies on :focus-visible (Chrome 86, Firefox 85, Safari 15.4). Measured on 4 December 2026 in Chromium, Firefox and WebKit: clean stop on hover, scale 1.1 read on the words, restart when the mouse leaves, same behaviour when a link takes focus, two independent lines in one page.

Chrome 86+✓ Full (measured)
Firefox 85+✓ Full (measured)
Safari 15.4+✓ Full with a mouse (WebKit engine measured)
Edge 86+✓ Full (Chromium engine)
iOS Safari 15.4+✓ Stop on touch not verified; Pause button measured (WebKit)
Android Chrome 86+✓ Stop on touch measured in emulation

Without JavaScript, the list is shown once, fixed, and the words still grow on hover. Without :focus-visible, the browser draws its own outline, cut at the top and bottom by the window of the line.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0192-root" data-speed="80" data-direction="left">
  <div class="hpmq-band">
    <div class="hpmq-viewport">
      <div class="hpmq-track">
        <ul class="hpmq-group" role="list">
          <li>A word</li>
          <li><a href="/page">A link</a></li>
          <li><button type="button">A button</button></li>
        </ul>
      </div>
    </div>
    <button type="button" class="hpmq-toggle" aria-pressed="false" aria-label="Pause"></button>
  </div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
--hpmq-zoom 1.1 Scale of the words during the hover or focus pause; 1 removes the growth.
--hpmq-space 4rem Gap between two words; keep it wider than what the zoom adds to the longest one.
data-speed / data-direction 80 / left Pixels per second at rest; right for the other direction.
--hpmq-color / --hpmq-size #fbbf24 / 1.5rem Hue and size of the words before they grow.
Words (HTML — one <li> each) 4 groups of words Text, link or button; the whole <li> grows, whatever it contains.
--hpmq-height / --hpmq-bg / --hpmq-padding 180px / #0a0a0f / 1rem 0 Dark demo frame, to neutralise in your page.
--hpmq-button / --hpmq-button-size rgba(255, 255, 255, .8) / 2rem Lasting-pause button.

FAQ

Both stop under the mouse. Basic Marquee does it without showing anything; Hover Pause enlarges the words during the stop, with the mouse as with keyboard focus, and sets that growth through a variable. Everything else (filling the line, Pause button, speed) is identical. If your words are clickable, the growth is worth the difference; for a plain message, Basic Marquee is enough.
Each word grows from its centre, without pushing its neighbours. A 200 px word gains 20 px at scale 1.1: if the gap between two words is smaller, they touch. Raise --hpmq-space, or lower --hpmq-zoom (1.05 is still noticeable).
There is no hovering with a finger. Measured: in Chrome for Android (emulated), touching the line stops and enlarges it until you touch elsewhere; in the Safari engine used for testing, touching the line does not stop it, and the behaviour on a real iPhone was not verified. The Pause button answers a finger in both: do not remove it.