日期:2014-05-16  浏览次数:20347 次

jquery制作二级导航菜单问题
利用表格单元格进行触发制作的下拉菜单

<table width="700" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td width="100" height="30" id="td1"><div align="center" class="STYLE1">要闻</div></td>
  <td width="100"><div align="center">公告</div></td>
  </tr>
.......

单元格td1进行触发


$(document).ready(function()
  {
  $("#tb1").hide();
   $("#Layer1").height("0px"); //初始状态
$("#td1").hover(function(){
 
$("#Layer1").animate({height:"215px"},300);
},function(){
 
$("#Layer1").animate({height:"0px"},300); 
  });


鼠标移到单元格td1上就可以触发该菜单层Layer1

但 我鼠标一移动到菜单层Layer上选择其二级内容时,鼠标就已经移出触发单元格区域tb1, 导致Layer1被隐藏。

如何改进代码才能使鼠标移动到二级菜单上也不触发tb1.hover的第二个动作。

------解决方案--------------------
加动画的有点麻烦啊,头疼。。看看高手怎么解决,顶上去