可以用 onmouseout="Menu.style.display='none';" 试试

解决方案 »

  1.   

    onmousedown里面加个判断if(Menu.style.display!='none')
    Menu.style.display='none'
      

  2.   

    都不行啊!用onmouseout="Menu.style.display='none';"的话,点击按钮连菜单都弹不出来了。苏乞儿的方法也不行。
      

  3.   

    <MENU>
    <LI onclick="alert('1')">This is the first item in the menu.
    <LI onclick="alert('2')">And this is the second item in the menu.
    </MENU>
    <script>
    function document.onclick(){
     evt=event.srcElement;
     if(evt.parentElement.tagName!="MENU")
      evt.parentElement.style.display="none";
    }
    </script>你要的是这个效果吗?
      

  4.   

    在按钮的响应事件里写event.cancelBubble  = true
      

  5.   

    为什么我用这句也不起作用啊!天哪!而且我感觉好象点击了后先去执行document.click,后执行button.click的,因为我把document.click改为弹出一个alert框(原先是隐藏菜单),就点击按钮时也弹一个alert,不弹菜单了:(
      

  6.   

    哈哈,终于好了!
    我原先用的是document.onmousedown,改成document.click就好了!
    谢谢kingdomzhf(旭日东升)和descreekert