Skip to content

24 ways to impress your friends

Vote up?

David Hund

Thanks for this good intro on Tabs, Remy.

There’s obviously some things that you’ve not dealt with (like you mention yourself) such as multiple tabs on a page, etc.

One other feature I often miss is keyboard arrow access. While it’s easy to tab through the tabs (wow…), it’s often nice to be able to use the left/right arrows too. A small enhancement.

Apart from those I noticed one bug: when you navigate from “Dizzy” (no hash) to “Ninja” the Back button does not work as expected. This is, of course, because the first tab “Dizzy” is active without a hash. To enable back-button functionality you’d have to initialize the first tab with a hash (or something like that).

Also: you can re-create much of this tab functionality with CSS and the `:target` pseudo-class. This would show/hide the tab panels even when JS is off/errs.