提示菜单用的东西,我想学习一下,一个小东西,研究一下 大家好啊 脚本之家 [Ctrl A 全选 注:如需引入外部Js需刷新才能执行] var h,l,t,w,mX,mY,e,srcE,thediv function showMenu(){ e=window.event?window.event:e; srcE=e.srcElement?e.srcElement:e.target; if(!srcE)return; thediv=document.getElementById('menudiv') h=srcE.offsetHeight; w=srcE.offsetWidth; //alert(h); l=srcE.offsetLeft+2; t=srcE.offsetTop+h; thediv.style.top=t; thediv.style.left=l; thediv.style.visibility="visible"; isvisible=true; } function hideMenu(){ e=window.event?window.event:e; srcE=e.srcElement?e.srcElement:e.target; thediv=document.getElementById('menudiv') if(!srcE)return; if(isvisible==true){ mX=e.clientX+document.body.scrollLeft; mY=e.clientY+document.body.scrollTop; if((mX<parseInt(thediv.style.left))||(mX>parseInt(thediv.style.left)+thediv.offsetWidth)||(mY<parseInt(thediv.style.top-h))||(mY>parseInt(thediv.style.top)+thediv.offsetHeight)) { thediv.style.visibility="hidden"; isvisible=false; } } }