Accessibility Widget Event Handling

The accessibility widget emits events in response to user interactions, such as changing options, profile, language, items or opening and closing menus.

Application of Event Detection Recording of these events enables:

  • Site interface integration – dynamically adjust content or styles in response to changes in the widget.
  • User interaction tracking – analyzing the use of accessibility features to optimize UI.
  • Synchronize settings – e.g., automatically adjust the language of the page when you change the language in the widget.

The following is a list of available events

NameDescription
AccessibilityOnChangeOptioncalled when any accessibility option is changed
AccessibilityOnChangeOptionContrastchange the contrast of the page
AccessibilityOnChangeOptionFontSizechange font size
AccessibilityOnChangeOptionInvertColorinvert page colors
AccessibilityOnChangeOptionUnderlineenable or disable underlining of links
AccessibilityOnChangeOptionDisableAnimationsdisable animations on the page
AccessibilityOnChangeOptionDyslexicuse of font for dyslexics
AccessibilityOnChangeOptionEnlargeCursorcursor enlargement
AccessibilityOnChangeOptionHideMediahide embedded media
AccessibilityOnChangeOptionLetterSpacingadjust letter spacing
AccessibilityOnChangeOptionLineHeightadjust text line height
AccessibilityOnChangeOptionSaturationadjust color saturation
AccessibilityOnChangeOptionShowLinedisplay a guide for easy reading
AccessibilityOnChangeOptionTextToSpeechactivation of text-to-speech conversion function
AccessibilityOnChangeProfilecalled when any accessibility profile is changed
AccessibilityOnChangeProfileAdhdactivation of profile for people with ADHD
AccessibilityOnChangeProfileBlindactivation of profile for blind people
AccessibilityOnChangeProfileCognitiveAndLearningprofile activation for people with cognitive and learning disabilities
AccessibilityOnChangeProfileColorBlindactivate profile for people with color blindness
AccessibilityOnChangeProfileDyslexiaprofile activation for dyslexia patients
AccessibilityOnChangeProfileEpilepticactivation of profile for people with epilepsy
AccessibilityOnChangeProfileLowVisionactivation of profile for visually impaired
AccessibilityOnChangeProfileMotorImpairedactivate profile for people with reduced mobility
AccessibilityOnMenuOpenopening the accessibility widget menu
AccessibilityOnMenuCloseclose the accessibility widget menu
AccessibilityOnChangePositionchange the position of the widget on the page
AccessibilityOnChangeLanguagechange the language of the widget

You can use these events in your application by listening for events like this:

window.addEventListener('AccessibilityOnChangeOption', function (event) { console.log(event.detail.type, event.detail.value); })

An example of sending an event to Google Tag Manager:

window.addEventListener('AccessibilityOnChangeOption', function (event) { window.dataLayer = window.dataLayer || [] window.dataLayer.push({ event: 'AccessibilityChange', optionType: event.detail.type, optionValue: event.detail.value }) })

Related posts

Still looking for answers?

Ask our experts using online chat

Contact us