Skip to content

Instantly share code, notes, and snippets.

@smeyer
Created June 29, 2012 17:36
Show Gist options
  • Select an option

  • Save smeyer/3019489 to your computer and use it in GitHub Desktop.

Select an option

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

smeyer commented Jun 29, 2012

Copy link
Copy Markdown
Author

Doesn't work in IE

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