求一段 鼠标覆盖,显示浮动层,鼠标移开浮动层消失,急用,高手帮帮忙?
发布网友
发布时间:2024-10-03 06:43
我来回答
共1个回答
热心网友
时间:2024-11-03 18:07
补充下代码:复制可直接使用。。我不是答案,我是楼主的小号,呵呵
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
<script type="text/javascript">
function showDiv(e)
{
var o = document.getElementById("hidDiv");
//o.style.left = e.clientX;//这种赋值方法,IE下可以,在firefox下不起作用
//o.style.top = e.clientY;
o.style.left = e.clientX+"px";
o.style.top = e.clientY+10+"px";
o.style.display="block";
}
</script>
</head>
<body>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ccff66;" onMouseOver="showDiv(event)">
</div>
<div style="width: 168px; height: 24px; background-color: #ffff66;" onMouseOver="showDiv(event)">
</div>
<div id="hidDiv" style="width: 238px; position: absolute; display: none; height: 120px;left: 228px; top: 22px; background-color: #ffcc33;">
</div>
</body>
</html>
参考资料:无