To keep the accordion nature intact when wanting to also use 'hide' and 'show' functions like .collapse( 'hide' )
, you must initialize the collapsible panels with the parent property set in the object with toggle: false
before making any calls to 'hide' or 'show'
// initialize collapsible panels
$('#accordion .collapse').collapse({
toggle: false,
parent: '#accordion'
});
// show panel one (will collapse others in accordion)
$( '#collapseOne' ).collapse( 'show' );
// show panel two (will collapse others in accordion)
$( '#collapseTwo' ).collapse( 'show' );
// hide panel two (will not collapse/expand others in accordion)
$( '#collapseTwo' ).collapse( 'hide' );