jQuery UI的Accordion小部件具有保持特定面板打开的活动选项,但我试图找到一种动态执行此操作的方法。
换句话说,我想在面板与页面对应时打开面板。
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 & 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>
因此,如果用户在RPO部分,则第一个面板将打开。如果在咨询部分,第二个面板将是开放的。