Give autoplay a real pause state
Separate a reader’s pause from temporary hover and visibility holds, then verify that manual browsing and keyboard navigation preserve the choice.

A rotating showcase can change the slide just as someone starts reading it. Adding a pause icon seems to solve the problem—until moving the pointer away quietly starts the timer again. The useful design question is whether the reader can hold a frame, explore another one and continue down the page without surrendering that choice.
This walkthrough uses an original three-project example. Its automatic mode advances every six seconds; that interval is a test setting, not a reading-time recommendation. The aim is a clear contract: stop means stay stopped, while Previous and Next keep working.
Give a pause somewhere to live
A hover rule describes where the pointer is. It does not remember what the reader asked for. If the same boolean controls both, leaving the card can erase an explicit stop. Store the reader’s permission to rotate separately from temporary conditions that make rotation inappropriate.
Original state diagram. Clearing a temporary hold must not overwrite the reader’s paused choice.Two different reasons the timer stops
Temporary hold
The environment interrupts otherwise permitted playback.
- A mouse pointer is over the showcase.
- The document becomes hidden.
- When the hold clears, check the reader’s choice again.
Reader pause
Playback remains disabled until an explicit Start.
- The reader stops automatic slides.
- Keyboard focus enters the showcase.
- Manual navigation does not silently opt back into autoplay.
This distinction also changes how you review the implementation. Look for one place that derives whether the timer may run. Hover exit, visibility changes and rendering should consult that decision; none should independently turn playback on. Clear an existing timer before starting another so repeated events cannot accumulate rotation loops.
Make the controls explain the current choice
The W3C carousel pattern describes a rotation control before the rotating content, manual slide controls, a stop when keyboard focus enters, and an explicit request before restarting after that focus stop. It also calls for rotation to stop on mouse hover. These are separate behaviors to design and check.
Real browser capture at a 900-pixel viewport. After Stop and pointer exit, slide 2 stayed selected through thirteen seconds of controlled browser time.In this example the button names the action available next: Start automatic slides while paused, Stop automatic slides while enabled. A nearby status explains a temporary hold without pretending the reader chose it. A mouse can hover over the controls while automatic mode remains enabled; that should hold the timer, not make the label’s intent ambiguous.
There is a small event-order trap here. Clicking Stop can focus the button before its click handler runs. If that focus handler already paused playback, blindly toggling the new state would restart it. The example retains the pointer’s intended action before focus changes state. Keyboard activation uses the current action instead. Test the outcome with actual input, not just a direct function call.
Keep manual browsing available
Pause is useful only if people can leave the controls. The WCAG explanation of Pause, Stop, Hide explicitly rejects a pause that works only while focus remains occupied. It also distinguishes moving content from auto-updating information: the latter does not have the five-second exception. A six-second slide interval is therefore not an escape from the need to consider user control.
Real browser capture at a 390-pixel viewport. Manual Next selected slide 3; moving focus to the reading notes did not restart playback.Previous and Next are ordinary buttons in this study. They change the selected slide, preserve focus on the activated control and keep playback paused. The inactive slides use the hidden attribute. The slide area is quiet while automatically rotating and uses a polite live region when stopped, following the carousel pattern’s live-region guidance. DOM checks do not establish what every screen reader will announce; that needs separate testing.
Derive playback from intent and context
function syncPlayback() {
clearInterval(timer);
const running = enabled
&& !hovered
&& !document.hidden;
timer = running
? setInterval(next, 6000)
: null;
}
// Stop and focus entry:
enabled = false;
syncPlayback();
This excerpt shows the timer decision, not a complete carousel. The Page Visibility API exposes whether the document is hidden and a change event for updating the decision. Returning to a visible tab should not erase an explicit pause. The fixture includes that handler; the recorded checks below do not claim a hidden-tab switching test.
For this optional showcase, the initial state is paused when prefers-reduced-motion requests reduced motion. That is an editorial choice for this example: the media feature communicates a preference, while the application decides how to respect it. Manual navigation stays available, and an explicit Start can enable rotation. A later change to reduced motion pauses it again.
Browser observations| Action | Result |
|---|
| Stop, then leave | Slide 2 held |
| Next, then leave | Slide 3 held |
| Tab in, then leave | Slide 1 held |
| Explicit Start | Timer advanced |
| Reduced motion | Paused; Next worked |
The first four paths were checked at 900, 390 and 320 pixels. A reduced-motion check ran at 390 pixels. The test advanced a controlled browser clock through the timer intervals and sent real pointer or keyboard events; it did not measure loading speed, reading speed or user preference. The screenshots show the resulting states, not the passage of time.
Review the escape path before the animation
A practical review pass
Stop, then move on
Activate Stop, move the pointer outside and focus another part of the page. Confirm the chosen slide stays put.
Browse while paused
Use Previous and Next with keyboard and pointer. Check selection, focus, button labels and the paused state together.
Restart deliberately
Activate Start and confirm one timer advances the slides. Enter another control and verify the focus-stop behavior again.
Check alternate conditions
Try a narrow viewport, reduced motion and a real background-tab return. Add assistive-technology checks before making a conformance claim.
If the showcase has no strong reason to advance itself, start with manual browsing. When automatic rotation earns its place, give the reader a durable way to stop it. A successful pause is visible in what happens after the reader leaves.
Back to the LOOKFILE blog