使用 jQuery,我想在菜单 li 悬停时显示子菜单,这样:当 .nav 有 ul.submenu 并且 .nav li 悬停时,显示 .submenu 并添加类 .arrow-down,然后在鼠标上再次隐藏它。
我的HTML如下:
<ul class="nav">
<li><a href="#">Home</a>
</li>
<li><a href="#">Facilities</a>
<ul class="submenu">
<li><a href="#">Coaching</a></li>
<li><a href="#">Performance Tests</a></li>
</ul>
</li>
<li><a href="#">Trainers</a>
<ul class="submenu">
<li><a href="#">Coaching</a></li>
<li><a href="#">Performance Tests</a></li>
</ul>
</li>
<li><a href="#">Membership</a>
<ul class="submenu">
<li><a href="#">Coaching</a></li>
<li><a href="#">Performance Tests</a></li>
</ul>
</li>
<li><a href="#">Schedule</a>
<ul class="submenu">
<li><a href="#">Coaching</a></li>
<li><a href="#">Performance Tests</a></li>
</ul>
</li>
</ul>
谢谢...