87,996
社区成员




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
body{margin:0px;padding:0px;}
#ulRegName {list-style:none;width:60px;}
#ulRegName li { list-style:none;width:60px;height:25px;border:1px solid #CDCDCD;}
#divlayer {width:100px;height:100px;background-color:#00CC33;display:none}
</style>
</head>
<body>
<ul id="ulRegName">
<li id="li1">列表一</li>
<li id="li2">列表二</li>
<li id="li3">列表三</li>
</ul>
<div id="divlayer">显示层 </div>
<script type="text/javascript">
window.onload = function(){
var o = document.getElementById('ulRegName');
var l = document.getElementById('divlayer');
o.onmouseover = function(){ l.style.display = 'block' };
o.onmouseout = function(){l.style.display = 'none'};
}
</script>
</body>
</html>
var a1 = document.getElementById('A1'),
b2 = document.getElementById('B2'),
div = document.getElementById('divlayer');
a1.onmouseover = function() { div.style.display = ''; }
a1.onmouseout = function(e) {
e = e || window.event;
var related = e.toElement ? e.toElement : e.relatedTarget;
if (related == b2) return;
div.style.display = 'none';
}
b2.onmouseout = function() { div.style.display = 'none'; }