我有一个带子菜单的菜单项。子菜单有五个itens,我使用jQuery来切换它。问题是只有子菜单的第一项是切换。这是代码:
<script type="text/javascript">
$(document).ready(function () {
$("ul.menu-body li:even").addClass("alt");
$('img.menu-head').hover(function () {
$('ul.menu-body').slideToggle('slow');
});
});
</script>
<ul>
...
<li id="menu-03">
<a href="galeria_representacao.php?image=0"><img src="images/representacao.jpg" class="menu-head" onMouseOver="this.src='images/representacao-hover.jpg'" onMouseOut="this.src='images/representacao.jpg'" /></a>
<ul class="menu-body">
<li><a href="galeria_representacao.php?image=0">Dixtal</a></li>
<li><a href="galeria_philips.php?image=0">Philips</a></li>
<li><a href="galeria_biosensor.php?image=0">BioSensor</a></li>
<li><a href="galeria_biorad.php">BioRad</a></li>
<li><a href="galeria_leica.php?image=0">Leica</a></li>
</ul>
</li>
...
</ul>