UNPKG

apex4x

Version:

The Comprehensive ARIA Development Suite

33 lines 2.36 kB
�� Function: announce(stringOrElementNode, boolDoNotRepeat) Description: Performs an unobtrusive announcement for screen reader users using a string message or the textual contents of a DOM element. Returns: String, domElement, or $A object if chained. Note: Designed to function automatically within screen readers that properly support ARIA live regions. The announce method is also prototyped to the String object for alternative usage. Method supports auto-queuing for rapid succession such as within live chat applications. Uses aria-live="polite" to prevent speech interruption when queued. Example: // Basic announcement of textual content within a DOM element. var myElement = $A.announce(domElement); // Announce a string message while suppressing repeat text var stringVariable = $A.announce(stringMessage, true); // Using strings // Basic announcement of a string object var stringVariable = "Downloading, please wait.".announce(); // Announce a string object while suppressing repeat text stringVariable.announce(true); // Manually clear the internal message queue $A.announce.clear(); // Or stringVariable.announce.clear();