<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>鼠标悬停提示效果</title>
<script language="javascript">
function showTip(elem,userid){
var x,y;
var e=event.srcElement
alert("获取属性信息:"+e.getAttribute("id"));
x = e.offsetLeft, y = e.offsetTop+20;
while(e=e.offsetParent)
{
x += e.offsetLeft;
y += e.offsetTop;
}
document.getElementById(elem).style.left = x;
document.getElementById(elem).style.top = y;
document.getElementById(elem).style.display = "block";
}
function hiddenTip(elem){
document.getElementById(elem).style.display = "none";
}
</script>
</head>
<body>
<label id="aa" onmouseover="showTip('tipdiv')" onmouseout="hiddenTip('tipdiv')">送元二使安西</label>
<div id="tipdiv" style="width:160px; height:100px; border:1px solid #999;
position:absolute;display:none; overflow:visible; padding:5px;
background:#fff;color:green;">渭城朝雨浥轻尘,<br>客舍青青柳色新。<br>劝君更
尽一杯酒,<br>西出阳关无故人。</div>
</body>
</html>