2011-10-29 37 views
-1
$("li.category-top >ul").hide(); 

    $(".category-top").mouseover(function(){ 
     $(this).children("ul").show(); 
    }); 
    $(".category-top").mouseleave(function(){ 
     $(this).children("ul").hide(); 
    }); 
+0

肯定採取以下穆的解決方案。 'hover()'結合了'mouseenter'和'mouseleave'。 ('mouseenter'總是比'mouseover'好得多。) – Sparky

回答

0

如果你把UL的到你的CSS爲顯示:沒有,那麼你可以保存隱藏行,只是有懸停()調用