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

http://jsfiddle.net/mtkp7/26/

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'); 

http://jsfiddle.net/9jzde/1/


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -