How to Accessibly Rotate Contents with jQuery

Yeah I’ve been using similar tabindex tricks here and there – I believe the general principle is known as “roving tabindex”, i.e. adjusting which elements are in the tab order according to the current context and activity, to minimize unnecessary tabbing. It works quite well, but can take a lot of code to get it right, and obviously has to be exactly right and thoroughly tested, to avoid causing problems for the user.

(I think a metric crap-ton is 0.568261 US crap-tons :-D)

But monitoring the focus position relative to a parent is not reliable enough, in my experience. There’s too much browser variation in their bubbling behaviour, and focus changes don’t necessarily mean keyboard navigation anyway.

The only situation I know of where Tab keypress monitoring doesn’t work, is when using Spatial Navigation in Opera 12 (since that uses Shift + Arrow Keys). But … well you know, Opera 12 is a dead browser! I don’t think it’s worth spending time trying to support it anymore.

Oh, and there’s Firefox in fullscreen mode – since FF has an “allow fullscreen” dialog with OK and Cancel buttons, if you use the Tab-key approach within the fullscreen element, then you make it impossible to Tab to that dialog. So I use the approach of setting everything else to -1 (but only for Firefox, since other browsers either don’t have that dialog, or don’t put it in the tab order anyway). Though really, fullscreen content should be treated as modal by the browser, but that’s a whole other world of issues!