Bootstrap 2 or Bootstrap 3 how to collapse open accordion -
i building own accordion markup using bootstrap collapse
does know how close open accordion when click on other?
i tried
//bs2 $('#top1_accordion').on('show','.collapse', function() { $('#top1_accordion').find('.collapse.in').collapse('hide'); }); //bs3 $('#top1_accordion').on('show.bs.collapse','.collapse', function() { $('#top1_accordion').find('.collapse.in').collapse('hide'); });
bootstrap 3 works on first click http://jsfiddle.net/4wsfk/1/
i got working on bootstrap 2
any appreciated!
i believe fiddle should work. removed class 'collapse' find statement. i'm not sure of differences in 3.0, must've changed markup slightly.
$('#top1_accordion').find('in').collapse('hide');
Comments
Post a Comment