<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript">
// JScript source code
function mo() {
var x = event.clientX, y = event.clientY; //定义返回事件发生时,mouse相对于客户窗口的X,Y坐标
//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') { //如果块级元素的visibility属性为hidden则执行以下操作
var width = 10;
var height = 20;
obj.style.left = x + 'px'; // 置元素的左边缘距离父元素左边缘的左边距离为Xpx
obj.style.top = y + 'px'; //设置元素的顶边缘距离父元素顶边缘的之上距离为Ypx
obj.style.visibility = 'visible'; //将块级元素的visibility从hidden变为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);
}
} <body>
<div id="sh" style="left:500px;border:solid 1px black; top:300px; width:200px; height:50px; position:absolute; visibility:hidden; filter: progid:DXImageTransform.Microsoft.Shadow (Color=#333333,Direction=130,strength=2) alpha(opacity=50) BlendTrans(duration=1); border:solid #999999 1px;z-index:1">//设置块级元素,具体里面的属性可以去百度一个个查
</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">
// JScript source code
function mo() {
var x = event.clientX, y = event.clientY; //定义返回事件发生时,mouse相对于客户窗口的X,Y坐标
//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') { //如果块级元素的visibility属性为hidden则执行以下操作
var width = 10;
var height = 20;
obj.style.left = x + 'px'; // 置元素的左边缘距离父元素左边缘的左边距离为Xpx
obj.style.top = y + 'px'; //设置元素的顶边缘距离父元素顶边缘的之上距离为Ypx
obj.style.visibility = 'visible'; //将块级元素的visibility从hidden变为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);
}
} <body>
<div id="sh" style="left:500px;border:solid 1px black; top:300px; width:200px; height:50px; position:absolute; visibility:hidden; filter: progid:DXImageTransform.Microsoft.Shadow (Color=#333333,Direction=130,strength=2) alpha(opacity=50) BlendTrans(duration=1); border:solid #999999 1px;z-index:1">//设置块级元素,具体里面的属性可以去百度一个个查
</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>
解决方案 »
- js 给html中得class添加样式 在ie6 7下不显示图片,代码如下
- 急,急,急,急,急,急!js错误,不能按我想的工作!!大家帮帮忙 啊!
- 怎么取得id为 "sub"+数字 的所有div?
- 写了个最简单的正则表达式 遇到问题 请各位高手帮忙
- 还是打印问题!
- 关于联动菜单
- a打开b,b打开c时关闭了a,『问』如何实现关闭c时刷新a
- 急,在线等待!!
- 这个字符串转换能不能只用一句正则表达式搞定? 请进。
- jsp中两个框中内容互换可以添加也可以移除 经过添加移除项提交后通过request.getParameterValues取不到最新数据
- 利用javascritp 求和。却得不到结果。。。
- 如何设置DIV的高度与宽度为当前可视区域高度与宽度?
if (document.all) obj = document.all.sh; //如上
if (document.layers) obj = document.layers.sh; //如上document.all 是微软的东西,只被IE4.0支持,document.getElementById 是公共标准,被目前的所有主流浏览器支持,document.layers是支持Netscape,他们的意思都是和document.getElementById一样的
if (document.all) obj = document.all.sh; //如果是IE内核(8。0版前)就找到SH对象并用OBJ对象指向他。
if (document.layers) obj = document.layers.sh; //同理