jquery - Bootstrap accordion doesn't collapse -
i have simple accordion code. on click on group title, content shown expected. when click on group title opened content doesn't hide.
i not want multiple content show @ same time , can't find doing wrong.
here accordion implementation, don't show content because it's dynamically generated , source of confusion more else :
<div id="accordion" class="panel-group"> // accordion members generated xslt template, in response // of window service <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapse{id}"> // section generated dynamically </a> </div> </div> <div id="collapse{id}" class="panel-collapse collapse"> <div class="panel-body"> // main content dynamically generated too. </div> </div> </div> </div>
<div id="accordion" class="panel-group"> // accordion members generated xslt template, in response // of window service <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseone"> // section generated dynamically </a> </div> </div> <div id="collapseone" class="panel-collapse collapse"> <div class="panel-body"> // main content dynamically generated too. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapsetwo"> // section generated dynamically </a> </div> </div> <div id="collapsetwo" class="panel-collapse collapse"> <div class="panel-body"> // main content dynamically generated too. </div> </div>
in example have 2 group , work properly. 1 condition every 1 have unique id.
Comments
Post a Comment