How to Accessibly Rotate Contents with jQuery

I do it by tracking Tab events. You’ve got a bunch of focusable elements within the modal which are in tab order – when you receive a Tab keydown on the last one, move focus to the first one; when you receive Shift+Tab on the first one, move focus to the last one.

You can’t do it with blur events (or DOM equivalents) because you have no way of knowing where the focus is moving to.

But I’ve not had any problems with the Tab approach … have you?