为什么我用了
("td .mu1").mouseover(function(){
$("td .xieh1").css({ display: "block", background: "#e5e5e5" });
});
再用
$("td .mul").mouseout(function(){$("td .xieh1").css({ display: "none"});});这一句怎么不执行了???
是一个下拉菜单,放上去的时候下拉菜单正常,离开时,这句好像没执行,按道理来说下拉菜单应隐藏的?高手指点一下

解决方案 »

  1.   

    $('td .mu1').bind("mouseenter",function(){$("td .xieh1").css({ display: "block", background: "#e5e5e5" }); 
    });$('td .mu1').bind("mouseleave",function(){$("td .xieh1").css({ display: "none"});});
      

  2.   

    $(document).ready(function(){
    $('td .mu1').bind("mouseenter",function(){$("td .xieh1").css({ display: "block", background: "#e5e5e5" });
    });$('td .mu1').bind("mouseleave",function(){$("td .xieh1").css({ display: "none"});}); })
      

  3.   

    $("td .mul").mouseout(function(){$("td .xieh1").css({ display: "none"});});
    用$("td.mul").bind("mouseleave",function(){});对他绑定一个鼠标滑过事件!
    要不然用hover:
    $("img.screenshot").hover(function(e){
       $("body").append("<p id='p"+this.id+"' class='po'><script>show_time();</script></p>");
       
    },
    function(){
    $("#p"+this.id).remove();
    });
      

  4.   

    $("td .mul").mouseout(function(){$("td .xieh1").css({ display: "none"});});
    用$("td.mul").bind("mouseleave",function(){});对他绑定一个鼠标滑过事件!
    要不然用hover:
    $("img.screenshot").hover(function(e){
       $("body").append("<p id='p"+this.id+"' class='po'><script>show_time();</script></p>");
       
    },
    function(){
    $("#p"+this.id).remove();
    });