Hi everyone,

Recently I've been working on a plugin for jQuery that will make adding
keyboard accessibility to your user interfaces a lot easier. In the process
of working on this, I ran into a number of inconsistencies in the way that
browsers handle the tabindex attribute. Getting, setting, and checking for
the presence of tabindex is a pretty common task for handling keyboard
accessibility, so I decided to roll this into a little plugin for jQuery.

I've documented the plugin on my blog, but here's a quick summary of how to
use it:

jQuery().tabindex() // Returns the tabindex value of the first matched
element, or undefined if no tabindex has been set.
jQuery().tabindex(value) // Sets the tabindex value all matched elements.
This will take either a String or a Number, but valid tabindex values should
be -1, 0, or a positive integer.
jQuery().removeTabindex() // Removes the tabindex attribute altogether from
all matched elements.
jQuery().hasTabindex() // Returns true if the first matched element has a
tabindex value, false if not.

More details available at:

http://fluidproject.org/blog/2008/01/11/jquery-tabindex-plugin/

Hopefully you'll find this plugin useful. If so, I'd be happy to contribute
it to the jQuery plugin repository. For the moment, you can get the plugin
from the Fluid Project's SVN repository at:

https://source.fluidproject.org/svn/sandbox/tabindex/trunk/jquery.tabindex.js

As mentioned, I'm working on a larger plugin that helps add keyboard
handlers for focusing and selecting items with the Tab key and arrow keys,
making it easier to support common accessibility keystrokes in your UIs.
It's still a work in progress, but please feel free to take a look and share
your thoughts. My blog entry provides more details about the API and how to
use it. There are a few bugs to fix, a few more methods to add, and I'll be
moving all of the code out of the fluid.access namespace and making the
low-level API private to the plugin. I'll send an announcement when it's
closer to being ready, but let me know if you're interested in collaborating
on it.

https://source.fluidproject.org/svn/sandbox/tabindex/trunk/KeyboardHandlers.js
https://source.fluidproject.org/svn/sandbox/tabindex/trunk/jquery.keyboard-a11y.js

We've been using jQuery in the Fluid Project (http://fluidproject.org), and
we've really been enjoying working with it. I'm looking forward to getting
more involved in the community!

Thanks,

Colin

---
Colin Clark
Technical Lead, Fluid Project
Adaptive Technology Resource Centre, University of Toronto
http://fluidproject.org

Reply via email to