Danny Garcia

Web design & content management.

Information

Danny Garcia (in the flesh)How's it going? I’m Danny and I believe that design directly affects the way we see the world. Follow me on any of the networks below to get to know me better!

I post most things here than anywhere else online. So if you would like to know me better and you've found this then you're all sorts of lucky. Congratulations!

Networks

Network icons by Komodo Media.


© 2009 — Danny Garcia, all rights reserved (except where cited).

Tumblelog


Let’s say…

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.

Posted as a link on Nov 5, 2008.