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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -