javascript获取鼠标坐标跟随控制层渐显信息提示效果(有BUG在调试中)

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript">
function mo()
{
var x=event.clientX,y=event.clientY;
//alert(ccc.offsetHeight+","+ccc.style.marginBottom);
if(document.getElementById&&!document.all) obj=document.getElementById("sh");
if(document.all) obj=document.all.sh;
if(document.layers) obj=document.layers.sh;
if(obj.style.visibility=='hidden')
{
var width=10;
var height=20;
obj.style.left=x+'px';
obj.style.top=y+'px';
obj.style.visibility='visible';
var timer = setInterval(function ()
{
width=width+10;
height=height+20;
if(height<200)
{
obj.style.width=width+'px';
obj.style.height=height+'px';
}
else{ clearInterval(timer);obj.innerHTML='华夏中文社区欢迎你的到来,谢谢支持';}
},1);
}
else
{
 var width=100;
 var height=200;
 obj.innerHTML='';
 var timer = setInterval(function ()
{
width=width-10;
height=height-20;
if(height>0)
{
obj.style.width=width+'px';
obj.style.height=height+'px';
}
else{ clearInterval(timer);obj.style.visibility='hidden';}
},1);
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>js牛X的信息提示效果</title>

<style type="text/css">
<!--
body {
 margin-top: 200px;
}
-->
</style></head>

<body>
<div id="sh" style="left:500px; top:300px; width:200px; height:50px; position:absolute; visibility: hidden; filter: progid:DXImageTransform.Microsoft.Shadow 
(Color=#333333,Direction=130,strength=2) alpha(opacity=30) BlendTrans(duration=1); border:solid #999999 1px;z-index:1">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><span style="color:#000000">http://www.hxzw.net</span>
      </td>
    </tr>
  </table>
</div>
<table width="250" border="0" cellspacing="0" cellpadding="0" id="ccc">
  <tr>
    <td height="25"><a href="http://www.hxzw.net" target="_blank" οnmοuseοver="mo()" οnmοuseοut="mo()">http://www.hxzw.net</a></td>
  </tr>
</table>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值