[CODE]<HTML>
<SCRIPT LANGUAGE="JavaScript" >
var IsDroped =false;
function mouseout()
{
window.event.srcElement.style.color = 'white';//鼠标移开时置为白色
}
function mouseover()
{
window.event.srcElement.style.color = 'red';//鼠标进入时置为红色//鼠标进入时置为红色
}
function doMenu(MenuID)
{
var CurMenu = document.all(MenuID);
//为避免闪烁,如果下拉菜单已经显示则不重画.
if (IsDroped==true)
{
window.event.cancelBubble = true;
return false;
}
window.event.cancelBubble = true;
TempMenu = CurMenu;
//计算下拉菜单的位置
x = window.event.srcElement.offsetLeft + window.event.srcElement.offsetParent.offsetLeft;
x2 = x + window.event.srcElement.offsetWidth;
y = pad.offsetHeight;
CurMenu.style.top = y;
CurMenu.style.left = x;
CurMenu.style.clip = "rect(0 0 0 0)";
CurMenu.style.display = "block";
//延时2毫秒后再显示菜单,保证ToolbarMenu.offsetHeight有值,避免从主菜单移向下拉菜单时下拉菜单消失.
window.setTimeout("showMenu()", 2);
return true;
}
function showMenu()
{
y2 = y + TempMenu.offsetHeight;
TempMenu.style.clip = "rect(auto auto auto auto)";
IsDroped =true;//下拉菜单已经显示
}
function hideMenu()
{
//如果在下拉菜单的范围之内移动则不隐藏.
cY = event.clientY + document.body.scrollTop;
if (cY>=y && cY<y2 && event.clientX >= (x+5) && event.clientX <= x2 ||
cY>1 && cY<y && event.clientX >= (x+5) && event.clientX <= x2-10)
{ window.event.cancelBubble = true; return;}
//隐藏
TempMenu.style.display = "none";
window.event.cancelBubble = true;
IsDroped =false;
}
</SCRIPT>
<body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>
<DIV ID='menu' STYLE='position:absolute;background-color:white;width:100%;top:0;left:0;'>
<DIV ID='pad' STYLE='position:relative;height:20;width:100%;font:bold 11pt 宋体;background-color:#007FFF;color:white;'>
<A TARGET='_top' TITLE='' ID='pad1' onmouseout="mouseout(); hideMenu();" onmouseover="mouseover(); doMenu('idpad1');">菜单项一</A>
<SPAN style="color:white"></SPAN>
<A TARGET='_top' TITLE='' ID='pad2' onmouseout="mouseout(); hideMenu();" onmouseover="mouseover(); doMenu('idpad2');" onclick="window.event.returnValue=false;">菜单项二</A>
</DIV>
</DIV>
<SPAN ID='idpad1' STYLE='display:none;position:absolute;width:70;background-color:#007FFF;padding-top:0;padding-left:0;padding-bottom:20;z-index:9;' onmouseout='hideMenu();'>
<HR STYLE='position:absolute;left:0;top:0;color:white' SIZE=1>
<DIV STYLE='position:relative;left:0;top:8;'>
<A ID='pad1' STYLE='text-decoration:none;cursor:hand;font:bold 11pt 宋体;color:white' HREF='11.htm' TARGET='_top' onmouseout="mouseout();" onmouseover="mouseover()">子菜单项</A><BR>
<A ID='pad1' STYLE='text-decoration:none;cursor:hand;font:bold 11pt 宋体;color:white' HREF='12.htm' TARGET='_top' onmouseout="mouseout();" onmouseover="mouseover()">子菜单项</A><BR>
<A ID='pad1' STYLE='text-decoration:none;cursor:hand;font:bold 11pt 宋体;color:white' HREF='13.htm' TARGET='_top' onmouseout="mouseout();" onmouseover="mouseover()">子菜单项</A>
</DIV>
</SPAN>
<SPAN ID='idpad2' STYLE='display:none;position:absolute;width:70;background-color:#007FFF;padding-top:0;padding-left:0;padding-bottom:20;z-index:9;' onmouseout='hideMenu();'>
<HR STYLE='position:absolute;left:0;top:0;color:white' SIZE=1>
<DIV STYLE='position:relative;left:0;top:8;'>
<A ID='pad2' STYLE='text-decoration:none;cursor:hand;font:bold 11pt 宋体;color:white' HREF='21.htm' TARGET='_top' onmouseout="mouseout();" onmouseover="mouseover()">子菜单项</A><BR>
<A ID='pad2' STYLE='text-decoration:none;cursor:hand;font:bold 11pt 宋体;color:white' HREF='22.htm' TARGET='_top' onmouseout="mouseout();" onmouseover="mouseover()">子菜单项</A><BR>
<A ID='pad2' STYLE='text-decoration:none;cursor:hand;font:bold 11pt 宋体;color:white' HREF='23.htm' TARGET='_top' onmouseout="mouseout();" onmouseover="mouseover()">子菜单项</A><BR>
<HR STYLE='color:white' SIZE=1><!--分隔行-->
<A ID='pad2' STYLE='text-decoration:none;cursor:hand;font:bold 11pt 宋体;color:white' onclick="parent.close()" onmouseout="mouseout();" onmouseover="mouseover()">退出系统</A>
</DIV>
</SPAN>
</BODY>
</HTML>[/CODE]