javascript获取鼠标坐标跟随控制层渐显信息提示效果(有BUG在调试中)
2008-05-31 17:34
876 查看
<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" onmouseover="mo()" onmouseout="mo()">http://www.hxzw.net</a></td>
</tr>
</table>
</body>
</html>
<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" onmouseover="mo()" onmouseout="mo()">http://www.hxzw.net</a></td>
</tr>
</table>
</body>
</html>
相关文章推荐
- 鼠标移过显示提示信息框(自动获取鼠标坐标)
- javascript跟随鼠标x,y坐标移动的字效果
- 图片定义的title提示信息的样式以及提示信息跟随鼠标的移动而移动的效果
- javascript跟随鼠标x,y坐标移动的字效果
- 基于JavaScript实现 获取鼠标点击位置坐标的方法
- JavaScript获取鼠标坐标
- jQuery实现鼠标经过弹出提示信息的地图热点效果
- 用 javascript 获取鼠标(光标)的坐标位置 兼容IE/Firefox等浏览器
- Jquery实现Mouseover显示跟随的提示信息效果
- javascript获取鼠标当前位置坐标 详细出处参考:http://www.jb51.net/article/27204.htm
- JavaScript 获取鼠标点击位置坐标
- JQuery实现一个简单的鼠标跟随提示效果
- javascript中获取当前鼠标的坐标
- JavaScript获取鼠标移动时的坐标(兼容IE8、chome谷歌、Firefox)
- easyui实现鼠标移到某一行,就会弹出一个提示信息效果
- Jquery地图热点效果-鼠标经过弹出提示信息
- javascript跟随鼠标的文字带滚动效果
- 获取cancvs上鼠标的坐标信息
- js-事件1_获取鼠标坐标clientX+scrollLeft及兼容性写法_跟随鼠标移动的divs
- javascript实时获取鼠标坐标值并显示的方法