Skip to content

Instantly share code, notes, and snippets.

@joecritch
Created August 1, 2011 11:12
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 joecritch/1117951 to your computer and use it in GitHub Desktop.
Save joecritch/1117951 to your computer and use it in GitHub Desktop.
$('.toggler').change(function() {
var showIt = !$(this).is(':checked');
var panel = $(this).closest('.field').nextAll('.hide');
if(showIt) {
panel.show().closest('fieldset').addClass('featured');
}
else {
panel.hide().closest('fieldset').removeClass('featured');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment