Skip to content
easeweb
Search topics

Timed pop-ups that open while you read or type

A sign-up pop-up opens ten seconds after the page loads, whatever people are doing, and nothing on the page lets them put it off or turn it off.

WCAG 2.2
SC 2.2.4AAA
Required by
Not required by Section 508 or EN 301 549
Broken setTimeout(() => signup.showModal(), 10000);
The accessibility problem illustrated: Cognitive:Where was I?
01

The problem

People reading or typing on the page have a pop-up they didn't ask for opened over their work, and nothing lets them put it off or turn it off.

02

Try it

Write a message to go inside the card, and take your time over it.

The shop’s ten seconds start when you first click or Tab into the page, and the demo clock counts them. Keep typing past ten seconds and see where your words go. Then apply each fix: press Get 10% off when you want the offer, or untick the setting before the time is up, and press Start over to load the page again.

Broken Can you fix this?

BrokenA sign-up pop-up that opens after ten seconds
Demo clock: starts when you first click or Tab into the page.

Fernleaf Paper

Wildflower birthday card

$4.50 · Pressed-flower print on recycled card. We write your message inside and post it for you.

Fernleaf Paper

Get 10% off your first order

Sign up for news of new designs and sales.

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Open the offer when people ask for it.

Before
BrokenA sign-up pop-up that opens after ten seconds
<main>  <h1>Wildflower birthday card</h1>  <form class="card-form">    <label for="card-message">Message inside the card</label>    <textarea id="card-message" name="message" rows="4"></textarea>    <button>Add to basket</button>  </form></main><dialog id="signup" aria-labelledby="signup-title">  <button type="button" class="signup-close" aria-label="Close">×</button>  <h2 id="signup-title">Get 10% off your first order</h2>  <p>Sign up for news of new designs and sales.</p>  <form method="dialog">    <label for="signup-email">Email address</label>    <input id="signup-email" name="email" type="email" autocomplete="email" autofocus required>    <button>Sign up</button>  </form></dialog>
What is wrong3 points

The pop-up itself is right: it is a native dialog, its × is a named button, Escape closes it, and closing it puts focus back where it was. Where it fails is when it opens.

  • It opens ten seconds after the page loads, whatever the person is doing at that moment.
  • Focus moves into the email field, so typing meant for the card goes into the pop-up, and a screen reader stops reading the page to read the pop-up.
  • Nothing on the page lets anyone put it off or turn it off before it comes.
After

A button that opens the offer

<p class="offer-bar">  New here?  <button type="button" id="offer-open">Get 10% off your first order</button></p><main>  <h1>Wildflower birthday card</h1>  <form class="card-form">    <label for="card-message">Message inside the card</label>    <textarea id="card-message" name="message" rows="4"></textarea>    <button>Add to basket</button>  </form></main><dialog id="signup" aria-labelledby="signup-title">  <button type="button" class="signup-close" aria-label="Close">×</button>  <h2 id="signup-title">Get 10% off your first order</h2>  <p>Sign up for news of new designs and sales.</p>  <form method="dialog">    <label for="signup-email">Email address</label>    <input id="signup-email" name="email" type="email" autocomplete="email" autofocus required>    <button>Sign up</button>  </form></dialog>
How it is fixed3 steps
  1. Delete the timer, so the pop-up never opens by itself.
  2. Put a button at the top of the page that says what it opens, "Get 10% off your first order". The offer is in front of every visitor from the moment the page loads, and in the same place on every page.
  3. Open the same pop-up from that button. Focus moves into the email field only because someone pressed the button, and closing the pop-up brings them back to it.

This fixes the Before and passes 2.2.4: nothing opens until it is asked for, so there is nothing to put off. The pop-up keeps its look; what changes is a slim bar at the top of the page that is there from the start.

04

Design ideas

An offer can stay in view without stopping anyone

Three more places for the sign-up that wait to be asked, and two fashionable ones that open by themselves. Tab or move the pointer into each sample, and press what it offers.

In the design file

  • Draw where the offer sits on the page at rest, on a phone and a wide screen, and the pop-up only as what its button opens.
  • Write on the button what it opens, such as “Get 10% off your first order”, not “Click here”.
  • Mark where focus goes when the pop-up opens, and that it goes back to the button when the pop-up closes.
  • If a timed pop-up has to stay, draw the setting that turns it off at the top of the page, and the page with it off.

Passes

  • Fernleaf Paper

    Wildflower birthday card

    $4.50 · Pressed-flower print on recycled card.

    10% off your first order

    A sign-up band inside the page A warm paper band between the card’s details and the next section, with its own heading, one field and a green Sign up pill, white on #2f5d50 at 7.49:1. Nothing covers the page; people meet it when they scroll to it, and it shows the whole offer without a press.
  • Fernleaf Paper

    Wildflower birthday card

    $4.50 · Pressed-flower print on recycled card.

    A “10% off” tab, there from the start A small green tab with a gift icon, fixed to the edge of the screen near the bottom, there as soon as the page loads, that never moves or grows by itself. Pressing it opens the sign-up beside it, with focus in the field; × or Escape closes it and puts focus back on the tab. Keep it clear of the content and of the focused control.
  • Your basket

    Wildflower birthday card $4.50

    Total $4.50

    Sign up and save $0.45 on this order.

    The offer beside the basket total A quiet line under the total, “Sign up and save $0.45 on this order”, in brown #6b5d4f at 6.36:1, with a Get 10% off button after it. The offer comes where the saving means something, and only opens the sign-up when it is pressed.

Fails

  • Fernleaf Paper

    Wildflower birthday card

    $4.50 · Pressed-flower print on recycled card.

    A slide-in once half the page is readWCAG 2.2.4 Tab or move the pointer into the sample and wait: the sign-up slides up over the lower half of the page and takes focus. It feels less pushy than a full pop-up, but it still opens in the middle of whatever people are reading or typing, and nothing lets them say no first. The sample does it once.
  • Fernleaf Paper

    Wildflower birthday card

    $4.50 · Pressed-flower print on recycled card.

    A spin-to-win wheel on arrivalWCAG 2.2.4 A bright wheel of prizes covers the page a moment after it opens, with Spin to win and a small “No thanks”. It is playful, but it stands between people and the page they came for, and the only choice it leaves them is to close it once it is there.
05

Verify the fix

5 checks, no mouse.

Test with: Keyboard, Screen reader

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after any change to the pop-up, the tools that show it, or their campaigns.

Limits

This is a starting pattern, not a guarantee for every application. It covers one sign-up pop-up opened on a timer. The snippets leave out what Sign up does with the address. Marketing and chat tools change their settings and campaigns without a deploy on your side, so their pop-ups need checking again after each change. Whether an interruption is an emergency is a judgement about your service, not something code can decide. Test the complete journey with the assistive technology your visitors use.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service