这样可以吗?
<html>
<head>
<title> New Document </title>
<script language="JavaScript">
<!--
function showDiv()
{
faceimg.style.display = "";
faceimg.style.top = window.event.x;
faceimg.style.left = window.event.y;
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" onclick="faceimg.style.display = "none";">
<img src="http://expert.csdn.net/images/csdn.gif" width="50" height="50" border=0 alt="" onmouseover="showDiv()" >
<div id="faceimg" style="position:absolute;display:none;border:1px solid red;width:100px">
<span><a href="#">详细资料</a></span><br>
<span><a href="#">详细资料</a></span><br>
<span><a href="#">详细资料</a></span>
</div>
</body>
</html>
<html>
<head>
<title> New Document </title>
<script language="JavaScript">
<!--
function showDiv()
{
faceimg.style.display = "";
faceimg.style.top = window.event.x;
faceimg.style.left = window.event.y;
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" onclick="faceimg.style.display = "none";">
<img src="http://expert.csdn.net/images/csdn.gif" width="50" height="50" border=0 alt="" onmouseover="showDiv()" >
<div id="faceimg" style="position:absolute;display:none;border:1px solid red;width:100px">
<span><a href="#">详细资料</a></span><br>
<span><a href="#">详细资料</a></span><br>
<span><a href="#">详细资料</a></span>
</div>
</body>
</html>
<style type="text/css">BODY, TD { FONT-SIZE:9pt; FONT-FAMILY:"ËÎÌå"; TEXT-DECORATION: none;}</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function OnCQQ(e,uid){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;
}
document.getElementById("CQQ_DIV").style.left=event.x;
document.getElementById("CQQ_DIV").style.top=event.y;
}
function QutCQQ(){
if(event.toElement.tagName != "TABLE"){
document.getElementById("CQQ_DIV").style.left=-100;
document.getElementById("CQQ_DIV").style.top=0;
}
}
function hide(){
if(event.toElement.id == "listBody"){
document.getElementById("CQQ_DIV").style.left=-100;
document.getElementById("CQQ_DIV").style.top=0;
}
}
//-->
</script></HEAD><BODY text="#000000" leftmargin="6" topmargin="6">
<div id="CQQ_DIV" style="position:absolute; width:60px; height:36px; z-index:1; left:-100px; top:0px;" onMouseOut="hide()">
<table width="60" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000" class="TABLE_TBLR_SB">
<tr><td height="18" align="center" bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#cc0000'" onMouseOut="this.style.backgroundColor='#ffffff'">·¢ËÍÏûÏ¢</td>
</tr>
<tr><td height="18" align="center" bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#cc0000'" onMouseOut="this.style.backgroundColor='#ffffff'">´«ËÍÎļþ</td>
</tr>
</table>
</div>
<table width="173" height="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#333333">
<tr valign="top">
<td width="173" colspan="4" bgcolor="#FFFFFF" style="padding-top:12px;"><table width="145" height="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666" class="TABLE_TBLR_SB">
<tr bgcolor="#FFFFFF" style="HEIGHT:25px;BACKGROUND-IMAGE: url(../images/THE_TOP_BG_2.gif);" height="4">
<td align="center" style="BORDER-BOTTOM: #7D7D7D 1px solid;text-align:center;width:40px;">²¿ÃÅ:</td>
<td align="center" style="BORDER-BOTTOM: #7D7D7D 1px solid;"><select name="select" style="width:100px;BORDER: #000000 1px solid;">
<option value="1" selected>È«²¿</option>
<option value="2">°ì¹«ÊÒ</option>
<option value="3">¹¤³Ì²¿</option>
<option value="4">¼¼Êõ²¿</option>
</select></td>
</tr>
<tr bgcolor="#FFFFFF">
<td id=listBody colspan="2" valign="top" style="padding-top:8px;padding-left:24px;line-height:180%;">
<span onclick="OnCQQ(this,'12');" onMouseOut="QutCQQ();" title="ÐÕÃû£ºÁõ½¨Ãñ ²¿ÃÅ£ºÈí¼þ²¿ µ±Ç°Î»ÖãºÊÂÎñ½»°ì ÔÚÏßÇé¿ö£ºÔÚÏß"><img src="../images/REN.gif" width="16" height="16">ÕÅÈý¶«</span><br>
<span onclick="OnCQQ(this,'12');" onMouseOut="QutCQQ();" title="ÐÕÃû£ºÈÎ˾»ú ²¿ÃÅ£ºÈí¼þ²¿ ×îºóλÖ㺴ý°ìÊÂÒË ÔÚÏßÇé¿ö£ºÀëÏß" CLASS="SYS_CQQ"><img src="../images/REN.gif" width="16" height="16">ÀîËÄ</span><br>
<span onclick="OnCQQ(this,'12');" onMouseOut="QutCQQ();" title="ÐÕÃû£ºÈÎ˾»ú ²¿ÃÅ£ºÈí¼þ²¿ ×îºóλÖ㺴ý°ìÊÂÒË ÔÚÏßÇé¿ö£ºÀëÏß" CLASS="SYS_CQQ"><img src="../images/REN.gif" width="16" height="16">ÈÎ˾</span>»ú<br>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr height="6">
<td height="6"></td>
</tr>
</table>
</BODY>
</HTML>
<style type="text/css">BODY, TD { FONT-SIZE:9pt; FONT-FAMILY:"宋体"; TEXT-DECORATION: none;}</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function OnCQQ(e,uid){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;
}
document.getElementById("CQQ_DIV").style.left=event.x;
document.getElementById("CQQ_DIV").style.top=event.y;
}
function QutCQQ(){
if(event.toElement.tagName != "TABLE"){
document.getElementById("CQQ_DIV").style.left=-100;
document.getElementById("CQQ_DIV").style.top=0;
}
}
function hide(){
if(event.toElement.id == "listBody"){
document.getElementById("CQQ_DIV").style.left=-100;
document.getElementById("CQQ_DIV").style.top=0;
}
}
//-->
</script></HEAD><BODY text="#000000" leftmargin="6" topmargin="6">
<div id="CQQ_DIV" style="position:absolute; width:60px; height:36px; z-index:1; left:-100px; top:0px;" onMouseOut="hide()">
<table width="60" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000" class="TABLE_TBLR_SB">
<tr><td height="18" align="center" bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#cc0000'" onMouseOut="this.style.backgroundColor='#ffffff'">发送消息</td>
</tr>
<tr><td height="18" align="center" bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#cc0000'" onMouseOut="this.style.backgroundColor='#ffffff'">传送文件</td>
</tr>
</table>
</div>
<table width="173" height="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#333333">
<tr valign="top">
<td width="173" colspan="4" bgcolor="#FFFFFF" style="padding-top:12px;"><table width="145" height="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666" class="TABLE_TBLR_SB">
<tr bgcolor="#FFFFFF" style="HEIGHT:25px;BACKGROUND-IMAGE: url(../images/THE_TOP_BG_2.gif);" height="4">
<td align="center" style="BORDER-BOTTOM: #7D7D7D 1px solid;text-align:center;width:40px;">部门:</td>
<td align="center" style="BORDER-BOTTOM: #7D7D7D 1px solid;"><select name="select" style="width:100px;BORDER: #000000 1px solid;">
<option value="1" selected>全部</option>
<option value="2">办公室</option>
<option value="3">工程部</option>
<option value="4">技术部</option>
</select></td>
</tr>
<tr bgcolor="#FFFFFF">
<td id=listBody colspan="2" valign="top" style="padding-top:8px;padding-left:24px;line-height:180%;">
<span onclick="OnCQQ(this,'12');" onMouseOut="QutCQQ();" title="姓名:刘建民 部门:软件部 当前位置:事务交办 在线情况:在线"><img src="../images/REN.gif" width="16" height="16">张三东</span><br>
<span onclick="OnCQQ(this,'12');" onMouseOut="QutCQQ();" title="姓名:任司机 部门:软件部 最后位置:待办事宜 在线情况:离线" CLASS="SYS_CQQ"><img src="../images/REN.gif" width="16" height="16">李四</span><br>
<span onclick="OnCQQ(this,'12');" onMouseOut="QutCQQ();" title="姓名:任司机 部门:软件部 最后位置:待办事宜 在线情况:离线" CLASS="SYS_CQQ"><img src="../images/REN.gif" width="16" height="16">任司</span>机<br>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr height="6">
<td height="6"></td>
</tr>
</table>
</BODY>
</HTML>
<script language="javascript">
var titleup_menu = null;
document.onclick = new Function("showTitle(null)")
function getPos(el,sProp) {
var iPos = 0;
while (el!=null) {
iPos+=el["offset" + sProp];
el = el.offsetParent;
}
return iPos;
}function showTitle(el, m,title) {
var slength = title.length; if (m) {
//alert(getPos(el,"Left"));
m.style.display='';
if (getPos(el,"Left")+180 > screen.width)
{
m.style.pixelLeft = getPos(el,"Left") - (180-10);
}else{
m.style.pixelLeft = getPos(el,"Left") + el.offsetWidth;
}
m.style.pixelTop = getPos(el,"Top");
m.innerHTML = '<table CELLPADDING=0 CELLSPACING=0>'+
'<tr><td>'+title+'</td></tr>'+
'</table>';
}
if ((m!=titleup_menu) && (titleup_menu)||slength == 0) titleup_menu.style.display = 'none';
titleup_menu = m;
}function hideTitle(el, m) {
if (el && m && m.style.display=='') {
if ((document.body.scrollLeft + window.event.x > el.offsetLeft)
&& (document.body.scrollLeft + window.event.x < el.offsetLeft + el.offsetWidth)
&& (document.body.scrollTop + window.event.y > el.offsetTop)
&& (document.body.scrollTop + window.event.y < el.offsetTop + el.offsetHeight)
|| (document.body.scrollLeft + window.event.x > m.offsetLeft)
&& (document.body.scrollLeft + window.event.x < m.offsetLeft + m.offsetWidth)
&& (document.body.scrollTop + window.event.y > m.offsetTop)
&& (document.body.scrollTop + window.event.y < m.offsetTop + m.offsetHeight)) {
} else {
m.style.display = 'none';
}
}
}function hideSelf(m) {
if (m.style.display=='') {
if ((document.body.scrollLeft + window.event.x >= m.offsetLeft)
&& (document.body.scrollLeft + window.event.x <= m.offsetLeft + m.offsetWidth)
&& (document.body.scrollTop + window.event.y >= m.offsetTop)
&& (document.body.scrollTop + window.event.y <= m.offsetTop + m.offsetHeight)) {
} else {
m.style.display = 'none';
}
}
}
//-->
</script>
<!--鼠标移动到用户名上出现的菜单---开始----------------------------------------->
<STYLE>.popmenu {
BORDER-RIGHT: #3c3a6c 1px solid; BORDER-TOP: #3c3a6c 1px solid; BORDER-LEFT: #3c3a6c 1px solid; LINE-HEIGHT: 18px; BORDER-BOTTOM: #3c3a6c 1px solid; POSITION: absolute; BACKGROUND-COLOR: #f4f6fc
}
</STYLE>
<SCRIPT src="/admin/js/popupmenu.js"></SCRIPT>
<DIV class=popmenu id=titleMenu style="DISPLAY: none" onmouseout=hideSelf(this)></DIV>
<!--鼠标移动到用户名上出现的菜单---结束------------------------------------------->
<!--这是我用到的事件响应,移到图片上出现内容提示-->
<td ><div align="center"><image src="<%=simplePicPath%>" width=100 height=100 border="0" onmouseover="showTitle(this, titleMenu,'<%=simpleContent%>')"
onmouseout="hideTitle(this, titleMenu)"></div></td>