我有一个自定义手风琴菜单,每个可扩展 UL (toggle_action) 旁边带有 [+] 链接以扩展其子级 (div_toggle)。对于主动
这是我的 HTML:
<ul class="topnav">
<li><h3 class="toggle_action"><img class="img-swap" src="/images/plus.gif"/>Governance</h3>
<ul class="div_toggle">
<li><h3><img src="/images/spacer.gif"/><a href="/governance">Governance</a></h3></li>
<li><h3 class="toggle_action"><img class="img-swap" src="/images/plus.gif"/>Board of Directors</h3>
<ul class="div_toggle">
<li><h3><img src="/images/spacer.gif"/><a href="/governance/bod" class="active">Board of Directors</a></h3></li>
<li><h3><img src="/images/spacer.gif"/><a href="/governance/bod/min">Minutes</a></h3></li>
</ul>
</li>
<li><img src="/images/spacer.gif"/><a href="/governance/com">Committees</a></h3></li>
</ul>
</li>
<li><h3 class="toggle_action"><img class="img-swap" src="/images/plus.gif"/>About</h3>
<ul class="div_toggle">
<li><h3><img src="/images/spacer.gif"/><a href="/about">About Us</a></h3></li>
<li><h3><img src="/images/spacer.gif"/><a href="/about/contact">Contact</a></h3></li>
</ul>
</li>
</ul>
和 jQuery:
$('.topnav a.active').parents().attr('src').replace('plus.gif','minus.gif');
我究竟做错了什么??提前致谢!