Skip to content

Instantly share code, notes, and snippets.

@wmeredith
Created September 11, 2015 22:31
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 wmeredith/000ba9df84a4ebd75e22 to your computer and use it in GitHub Desktop.
Save wmeredith/000ba9df84a4ebd75e22 to your computer and use it in GitHub Desktop.
A quick button for collapsing bootstrap panel-body and panel-footer from the panel-heading.
$('.bootstrapPanelCollapse').click(function() {
var $pBody = $(this).closest('.panel').find('.panel-body');
var $pFooter = $(this).closest('.panel').find('.panel-footer');
$.merge($pBody,$pFooter).slideToggle();
$(this).find('.glyphicon').toggleClass('glyphicon-chevron-down');
$(this).find('.glyphicon').toggleClass('glyphicon-chevron-up');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment