Skip to content

Instantly share code, notes, and snippets.

@smeyer
Created June 29, 2012 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smeyer/3019489 to your computer and use it in GitHub Desktop.
Save smeyer/3019489 to your computer and use it in GitHub Desktop.
switcher
<script type="text/javascript">
$(document).ready(function() {
switchers = $('#switchers > li');
states = $('#state_info > div');
switchers.each(function(idx) {
$(this).data('state', states.eq(idx));
}).click(
function() {
switchers.removeClass('active');
states.removeClass('active');
$(this).addClass('active');
$(this).data('state').addClass('active');
});
});
</script>
@smeyer
Copy link
Author

smeyer commented Jun 29, 2012

Doesn't work in IE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment