twitter bootstrap - How to make accordion's content to be opened even by clicking outside the link's text? -


i created accordion :

<div class="box-group" id="accordion">      <c:foreach items="${groupe_menus}" var="groupe_menu">          <div class="panel box box-primary">             <div class="box-header with-border">                 <h4 class="box-title">                     <a data-toggle="collapse" data-parent="#accordion" href="#content_${groupe_menu.gmnu_code}" aria-expanded="false" class="collapsed">                         ${groupe_menu.gmnu_lib}                     </a>                 </h4>             </div>             <div id="content_${groupe_menu.gmnu_code}" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">                 ... // accordion's content             </div>          </div>      </c:foreach>  </div> 

at runtime mandatory click accordion's link text content opened. how make possible open content clicking box header region ?

i found :

<script type="text/javascript">      $(function() {          $("#accordion").find($("div.box-header")).each(function(){             var region_titre = $(this);             region_titre.on("click", function(){                 var links = region_titre.find("a");                 var premierlink = links[0];                 premierlink.click();             });         });      });  </script> 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -