Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Latest commit

 

History

History
41 lines (36 loc) · 1.46 KB

README.md

File metadata and controls

41 lines (36 loc) · 1.46 KB

announceThis

announceThis is a jquery plugin to dynamically create aria-live regions such as alerts, status messages, and log updates programmatically.

Usage

Alert

	$.announceThis({
        role: 'alert',
        message: 'This is an example of an alert message'
    });

Status

	$.announceThis({
        id: 'statusContainer',
        role: 'status',
        ariaLive: 'assertive'
        message: 'This is an example of an updated status message',
        ariaRelevant: 'additions removals'
    });

All options

	$.announceThis.defaults = {
        id: "announceThis",       // id of live region
        role: "status",           // log, alert, status, progressbar, marquee, timer
        ariaLive: "assertive",    // polite, assertive, alert (automatically becomes "alert" when role: "alert")
        ariaAtomic: false,        // present live region as a whole (support across screenreader/browser combinations is sketchy)
        ariaRelevant: "",         // 'additions', 'additions removals', 'removals' - does not work with role: alert
        message: ""               // message to pass to screenreader
    };

Notes

  • When using the same ID, the first instance of options will be the options used
  • role: 'alert' ignores all options except for message

Known Issues