rockstar February 2016

first element not collapsing in bootstrap

I am using collapse using bootstrap.I am trying to collapse first element but its not working.Here's my code

<li class="c-bg-before-yellow list-group-item c-dropdown" style="font-size: 16px;font-weight:500;">
    <a class="analytics collapsed" role="button" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">AUDIT &amp; ASSURANCE</a>
    <div class="collapse" id="collapseExample" aria-expanded="false" style="height: 0px;">
        <ul class="c-dropdown-menu c-content-list-1 c-theme  c-square listsss">
            <li class="c-bg-before-yellow">
                <a href="external_audits.php" class="">External Audits</a>
            </li>
            <li class="c-bg-before-yellow">
                <a href="internal_audits.php" class=" ">Internal Audits</a>
            </li>
            <li class="c-bg-before-yellow">
                <a href="rera_audits.php" class=" ">RERA Audits</a>
            </li>
            <li class="c-bg-before-yellow">
                <a href="agreed_upon_procedures.php" class=" ">Agreed Upon Procedures</a>
            </li>
        </ul>
    </div>
</li>

Answers


Oyeme February 2016

By default, it will be auto-expanded.You need to use accordion.

<ul>
<li  class="accordion" id="accordion2">
    <div class="accordion-group">
        <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2"
            href="#collapseOne">  
            AUDIT &amp; ASSURANCE
         </a> 
        </div>
        <div id="collapseOne" class="accordion-body collapse in">
            <div class="accordion-inner">
              <ul class="c-dropdown-menu c-content-list-1 c-theme  c-square listsss">
            <li class="c-bg-before-yellow">
                <a href="external_audits.php" class="">External Audits</a>
            </li>
            <li class="c-bg-before-yellow">
                <a href="internal_audits.php" class=" ">Internal Audits</a>
            </li>
            <li class="c-bg-before-yellow">
                <a href="rera_audits.php" class=" ">RERA Audits</a>
            </li>
            <li class="c-bg-before-yellow">
                <a href="agreed_upon_procedures.php" class=" ">Agreed Upon Procedures</a>
            </li>
        </ul>
            </div>
        </div>
    </div>
</<li>
</ul>

http://jsfiddle.net/yYuRz/52/

Post Status

Asked in February 2016
Viewed 2,123 times
Voted 4
Answered 1 times

Search




Leave an answer