Menu icon Foundation
How to trigger an accordion to toggle using one JavaScript (with Jquery) Command

Hello. I was browsing the forum and trying to find the specific command to trigger and accordion to toggle and I could not find it. I have this code for the accordion on my website and was wondering how you do it with JavaScript or Jquery. I found this command:

$("#ACR").foundation('toggle',$("#Layer Menu"));

From a past post that I copied and modified to fit my own code, (http://foundation.zurb.com/forum/posts/36914-605---how-to-trigger-accordion-toggle) and it only closes the accordion. Thanks in advance for the help! (Note that there is nothing in the current accordion because that would only make things more complicated)

<div class="columns large-3">
<div style="height:6px" class="clearfix clear-columns"></div>
<ul id="ACR" class="accordion" data-accordion role="tablist" data-allow-all-closed="true">
<li class="accordion-item">
<a style="height:60px" href="#panel173" role="tab" class="accordion-title" id="panel173-heading" aria-controls="panel173"><h5>Layer Menu</h5></a>
<div id="Layer Menu" class="accordion-content" role="tabpanel" data-tab-content aria-labelledby="panel173-heading"></div>
</li>
</ul>
</div>

accordiontogglejavascriptjquery

Hello. I was browsing the forum and trying to find the specific command to trigger and accordion to toggle and I could not find it. I have this code for the accordion on my website and was wondering how you do it with JavaScript or Jquery. I found this command:

$("#ACR").foundation('toggle',$("#Layer Menu"));

From a past post that I copied and modified to fit my own code, (http://foundation.zurb.com/forum/posts/36914-605---how-to-trigger-accordion-toggle) and it only closes the accordion. Thanks in advance for the help! (Note that there is nothing in the current accordion because that would only make things more complicated)

<div class="columns large-3">
<div style="height:6px" class="clearfix clear-columns"></div>
<ul id="ACR" class="accordion" data-accordion role="tablist" data-allow-all-closed="true">
<li class="accordion-item">
<a style="height:60px" href="#panel173" role="tab" class="accordion-title" id="panel173-heading" aria-controls="panel173"><h5>Layer Menu</h5></a>
<div id="Layer Menu" class="accordion-content" role="tabpanel" data-tab-content aria-labelledby="panel173-heading"></div>
</li>
</ul>
</div>