Skip to main content
WCAGrules
Quick navigation

Stop scripted blinking within five seconds

No partner technique, no qualifier, nothing bolted on. SCR22 is a sufficient technique on its own, and one of the cleanest entries in this whole library. The script that starts the blink also owns the toggle and also owns the ending. Five seconds is the outer limit. The usual shape is one interval flipping visibility against one timeout that clears it. Our own addition, which is not written into the technique, is that the content should end up visible. A blink that stops on the hidden frame has not calmed down, it has deleted something, and the reader is left looking at a gap where a message used to be. If the blinking is doing real work rather than decoration, look at SCR33 for the scrolling case or SCR36 for a static alternative instead.

How we find it in an audit

The check is a stopwatch. It takes five seconds. Start the timer when the blinking starts, and see whether it has stopped by the time the timer does. Automated tools can spot an interval toggling visibility or opacity in script, which narrows where to look. They cannot tell a blinking promotion from a blinking progress indicator that is genuinely part of the task. So a reviewer decides what the movement is for before deciding whether it belongs. We also check what state the content is left in once the blinking ends.

How affected users experience it

Blinking is worst for the people least able to leave the page. A reader with an attention or cognitive disability loses the sentence they were on every time the movement catches their eye. They start it again. They lose it again. Someone using a screen magnifier sees a much larger version of the same flicker in a much smaller window. And a reader who needs longer than most to take a line in is the one who most needs the line to hold still, which is exactly what a permanent blink refuses to do.

Passes vs. fails

Passes: under the flash threshold. Fails: flashing above 3 per second.

Passes

var blink = setInterval(toggleBanner, 400);
setTimeout(function () { clearInterval(blink); showBanner(); }, 4500);
// Stops at 4.5 seconds, and the banner is left on screen rather than hidden.

Fails

setInterval(toggleBanner, 400);
// The SALE banner blinks for as long as the page is open.

How this gets tested

The W3C publishes test rules that define what a checker looks for here.

Other ways to satisfy this rule

11 guides on this site are filed under 2.2.2 Pause, Stop, Hide. W3C lists this one as sufficient for that rule on its own. Implement it correctly, in a way your readers' software actually supports, and the rule is met.

This guide is our interpretation of W3C technique SCR22: Using scripts to control blinking and stop it in five seconds or less. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations