Keyboard Accessibility for jQuery and Infusion
Jul 9th, 2009 by colin
Lots has changed since I last posted about Fluid’s keyboard accessibility plugins for jQuery. Here’s a quick summary of what’s new:
We’ve donated our tabindex normalization functions to jQuery, and they’re available directly in jQuery 1.3. Here’s an example of how to use them:
$().attr("tabindex"); // Gets the tabindex of the first matched element.
$().attr("tabindex", -1); // Sets the tabindex value of all elements in this jQuery instance.
This now works consistently across all browsers in the jQuery way! There are some other tabindex-related conveniences in jQuery UI 1.7 core, too:
$().focusable(); // Returns true if the first matched element is currently focusable.
$().tabbable(); // Returns true if the first matched element can be focused using the Tab/Shift-Tab keys.
Thanks so much to Scott Gonzalez for helping us land these patches in jQuery!
In my previous blog post about keyboard accessibility, I hinted at a comprehensive keyboard accessibility library that makes it easy to support desktop-style navigation with the keyboard. This plugin now ships as part of our Fluid Infusion application framework. It also works as a standalone jQuery plugin if you don’t need the rest of Infusion’s great features.
If you’re interested in this plugin, here are a few links to get you started:
- Keyboard Accessibility API Documentation
- Keyboard Accessibility Tutorial
- An example showing keyboard navigation and ARIA with jQuery UI Tabs
- Source code for the jquery.keyboard-a11y.js plugin
As always, comments, feedback, and suggestions are welcome.