Skip to content

Instantly share code, notes, and snippets.

@orangexception
Last active January 2, 2016 09:48
Show Gist options
  • Save orangexception/8285123 to your computer and use it in GitHub Desktop.
Save orangexception/8285123 to your computer and use it in GitHub Desktop.
A short fix for latest Bootstrap's collapsable accordions in IE7+.
// Bootstrap IE Collapsable Accordion Issue
if( $.browser.msie ) {
// Accordion Toggle Click Handler
$( ".accordion-toggle" ).click( function() {
// Get Accodion Root
domAccordion= $( this ).parents( ".panel-group" );
// Hide All Collapsable
domAccordion.children( ".collpase" ).removeClass( "in" );
// Collapse All Buttons
domAccordion.children( ".accordion-toggle" ).addClass( "collapsed" );
// Remove Collapsed Button
$( this ).removeClass( "collapsed" );
// Show Selected
$( $( this ).attr( "href" ) )
.addClass( "in" )
.css( "height" , "auto" );
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment