2008年4月9日星期三

鼠标移入中显示提示信息

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<style type="text/css">
<!--

.#opstatdiv {
   visibility: hidden;
   background-color: #f7fcfe;
   z-index: 100;
   width: 200px;
   height: 50px;
   position: absolute;
   text-align: left;
   font-size: 12px;
   color: #FF0000;
   font-weight: bold;
   vertical-align: middle;
}
-->
</style>
<script type="text/javascript">

function showOpstatView()
{
var msgStr = "提示信息";
var d_dialog = document.getElementById('opstatdiv');
d_dialog.innerHTML = msgStr;
d_dialog.style.posLeft = document.body.scrollLeft + event.clientX + 10;
d_dialog.style.posTop = document.body.scrollTop + event.clientY;
  
d_dialog.style.visibility='visible';

}

function opstatDivClose()
{
    var d_dialog = document.getElementById('opstatdiv');
    d_dialog.style.visibility='hidden';
}

</script>
</HEAD>

<BODY>
<div id="opstatdiv"></div>
<table>
<tr>
   <td onmouseover="javascript:showOpstatView()" onmouseout="javascript:opstatDivClose()">>
   靠近我
   </td>
</tr>
</table>
</BODY>
</HTML>

1 条评论: