0

jQuery UI's Accordion widget has the active option to keep a certain panel open, but I'm trying to find a way to do this dynamically.

In other words, I want to have a panel open when it corresponds with the page.

HTML:

      <ul id="nav-side" class="accordion">
        <li class="accordion-title"><a href="#">RPO</a>
            <ul>
            <li><a href="/services/direct/rpo/index.php">Value</a></li>
            <li><a href="/services/direct/rpo/solution-competencies.php">Solution Competencies</a></li>
            <li><a href="/services/direct/rpo/rpo-models.php">Defined RPO Models</a></li>
            <li><a href="/services/direct/rpo/program-management.php">Dedicated Program Management</a></li>
            <li><a href="/services/direct/rpo/solution-planning.php">Solution Planning &amp; Implementation</a></li>
          </ul>
        </li>
        <li class="accordion-title"><a href="#">CONSULTING</a>
            <ul>
            <li><a href="/services/direct/consulting/index.php">#</a></li>
            <li><a href="#">#</a></li>
            <li><a href="#">#</a></li>
          </ul>
        </li>
        <li class="accordion-title"><a href="#">CRM</a>
            <ul>
            <li><a href="#">#</a></li>
            <li><a href="#">#</a></li>
            <li><a href="#">#</a></li>
          </ul>
        </li>
      </ul>

So if the user is in the RPO section, the first panel would be open. If in the Consulting section, the second panel would be open.

2
  • possible duplicate of jquery accordion, opening a box based on href
    – apaul
    May 22, 2014 at 22:27
  • That example isn't what I'm looking for. I'm using the accordion as a navigation menu, so it needs to translate across different pages, not the same page.
    – jenhan
    May 23, 2014 at 18:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.