div跟随鼠标悬浮显示

<span style="font-size:18px;"><!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
<style>  
   #hint{  
    width:198px;  
    height:200px;
    border:1px solid #000000;  
    background:#99ff33;  
    position:absolute;  
    z-index:9;  
    padding:6px;  
    line-height:17px;  
    text-align:left;  
    top:1520px;  
   }  
</style> 
<script type="text/javascript">
 	function showme(){  
	     var oSon = window.document.getElementById("hint");  
	     if (oSon == null) return;  
	     with (oSon){  
	      	style.display = "block";  
	      	style.pixelLeft = window.event.clientX + window.document.body.scrollLeft + 6;  
	      	style.pixelTop = window.event.clientY + window.document.body.scrollTop + 9;  
	     }  
    }  

    function hideme(){  
	     var oSon = window.document.getElementById("hint");  
	     if(oSon == null) return;  
	     oSon.style.display="none";  
    }  
</script>
 <body>  
   <a href="#" οnmοuseοver="showme()">测试div跟随鼠标悬浮显示1</a><br/><br/>
   <a href="#" οnmοuseοver="showme()" οnmοuseοut="hideme()">测试div跟随鼠标悬浮显示2</a><br/><br/>
   <a href="#" οnmοuseοver="showme()" οnmοuseοut="hideme()" οnmοusemοve="showme()">测试div跟随鼠标悬浮显示3</a><br/><br/>
   <a href="#" οnmοuseοver="showme()" οnmοuseοut="hideme()" >测试div跟随鼠标悬浮显示4</a><br/><br/>
   <div id="hint" style="display:none" οnmοuseοut="hideme()">
   		哈哈哈哈哈哈	
   		<input type="button" οnclick="test()" value="按钮"/>
   		<a href="index.jsp">链接</a>
   </div>  
  </body>  
</html></span>

效果:





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值