javascript轻松实现当鼠标移开时已弹出子菜单自动


<html>
<head>
<style type="text/css">
.menu
{
background-color:green;
width:120;
height:20;
color: white;
text-align: center;
font-size:9pt;
font-weight:bolder;
}
.submenu
{
position:absolute;
top:40;
background-color:
yellow;width:180;
font-size:9pt;
}
</style>
</head>

<body>
<SCRIPT>
var cm=null;
document.onclick = new Function("show(null)")
function getPos(el,sprop)
{var iPos = 0
while (el!=null)
{iPos+=el["offset" + sprop]
el = el.offsetParent}
return iPos}
function show(el,m)
{if (m) { m.style.display='';
m.style.pixelLeft = getPos(el,"Left")
m.style.pixelTop = getPos(el,"Top") + el.offsetHeight}
if ((m!=cm) && (cm)) cm.style.display='none';cm=m}
</SCRIPT>

<table border=0>
<tr>
<td>杂志技术站点</td>
<td>门户站点</td>
<td>个人收藏站点</td>
</tr>
</table>

<DIV onmouseleave="this.style.display='none'">
<BR><A HREF="https://www.yesky.com">天极网 Yesky.com</A>
<BR><A HREF="https://www.cbinews.com">电脑商情报</A>
<BR><A HREF="https://www.newsoft.com.cn">新潮电子</A>
<BR>
</DIV>
<DIV onmouseleave="this.style.display='none'">
<BR><A HREF="https://www.sina.com.cn">新浪网 Sina</A>
<BR><A HREF="https://www.sohu.com.cn">搜狐 Sohu</A>
<BR><A HREF="https://www.163.com">网易 Netease</A>
<BR>
</DIV>
<DIV onmouseleave="this.style.display='none'">
<BR><A HREF="https://haoel.yeah.net">耗子网络编程站</A>
<BR><A HREF="https://www.5460.net">中国同学录</A>
<BR><A HREF="https://www.csdn.net">中国软件开发网</A>
<BR>
</DIV>
</body>
</html>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdwwpf.html