Pages tagged switcheroo:

The Ol' Switcheroo - Snook.ca
http://snook.ca/archives/javascript/jquery-plugin-switcheroo/

finally!
You have an element and within that element you want an item to be clicked on and set as active. Then you want to click on another item and have it to be set as active. Maybe it's navigation, maybe it's tabs. This is a common pattern. So much so, that I've rewritten this code a few times but keep losing track of it. This is a jQuery plugin that does the ol' switcheroo and is very simple. When you click on an element, it'll set it as active. When you click on another, it'll remove the active class from the currently active item and then enable the active item. Super simple, nothing more, nothing less.
Handy javascript for addingremiving classes to things like navigation.
active state navigation with javascript
You have an element and within that element you want an item to be clicked on and set as active. Then you want to click on another item and have it to be set as active. Maybe it's navigation, maybe it's tabs. This is a common pattern. Snook.ca