js源码--动态层
来源:互联网 发布:网络机顶盒迪优美特 编辑:程序博客网 时间:2024/05/18 01:15
<style type="text/css">
body ...{
height:100%;
}
.wc, #wc1, #wc2 ...{
position:absolute;
border-width:0px;
z-index:2;
left:0px;
top:0px;
display:none
}
#wc1 ...{
width:320px;
height:240px;
background-color:#FFCC00;
}
#wc2 ...{
width:420px;
height:340px;
background-color:#CCCCCC;
}
.wc ...{
z-index:1;
}
</style>
<html>
<head>
</head>
<body>
<div id="wc1"></div>
<div id="wc2"></div>
<center>
<button id="show_wc1">show_wc1</button>
<button id="show_wc2">show_wc2</button>
<div id="id3"></div>
<form name="form1" method="post" action="">
<input type="submit" name="Submit" value="提交">
</form>
<br />
</center>
</body>
</html>
<script language="javascript">
window.onload=init;
function init()...{
div1=document.getElementById("wc1")
div2=document.getElementById("wc2")
button1=document.getElementById("show_wc1")
button2=document.getElementById("show_wc2")
add(div1,button1)
add(div2,button2)
}
function add(o,p)...{
o.style.display="block";
o.top=p.offsetTop+p.offsetHeight;
o.left=p.offsetLeft+Math.ceil(p.offsetWidth/2);
o.style.left=parseInt(o.left)-Math.ceil(o.offsetWidth/2)
o.style.top=o.top
o.width = (o.offsetWidth) / 20;
o.height = (o.offsetHeight) / 20;
o.num = 0;
o.style.width=0;
o.style.height=0
o.style.display="none";
p.onmouseover=o.onmouseover=function()...{move(o)};
p.onmouseout=o.onmouseout=function()...{out(o)};
}
function move(o)...{
window.clearTimeout(o.time)
window.status=o.num
if (++o.num<=20)...{
o.style.display="block";
o.style.width=(o.num * o.width) + "px";
o.style.height=(o.num * o.height) + "px";
o.style.left=parseInt(o.left)-(o.offsetWidth/2)
o.clear=window.setTimeout(move, 10, o);
}
else...{
window.clearTimeout(o.clear);
}
}
function out(o)...{
window.clearTimeout(o.clear)
window.status=o.num
if(--o.num>=0)...{
o.style.width=(o.num * o.width) + "px";
o.style.height=(o.num * o.height) + "px";
o.style.left=parseInt(o.left)-(o.offsetWidth/2)
o.time=window.setTimeout(out, 10, o);
}
else...{
o.style.display="none"
window.clearTimeout(o.time);
}
}
(function () ...{
var timeout = window.setTimeout;
window.setTimeout = function (a, b) ...{
var fun;
if ("function" == typeof a) ...{
var arg = Array.prototype.slice.call(arguments, 2);
fun = function () ...{
a.apply(null, arg);
};
} else ...{
fun = a;
}
return timeout(fun, b);
};
})();
</script>
body ...{
height:100%;
}
.wc, #wc1, #wc2 ...{
position:absolute;
border-width:0px;
z-index:2;
left:0px;
top:0px;
display:none
}
#wc1 ...{
width:320px;
height:240px;
background-color:#FFCC00;
}
#wc2 ...{
width:420px;
height:340px;
background-color:#CCCCCC;
}
.wc ...{
z-index:1;
}
</style>
<html>
<head>
</head>
<body>
<div id="wc1"></div>
<div id="wc2"></div>
<center>
<button id="show_wc1">show_wc1</button>
<button id="show_wc2">show_wc2</button>
<div id="id3"></div>
<form name="form1" method="post" action="">
<input type="submit" name="Submit" value="提交">
</form>
<br />
</center>
</body>
</html>
<script language="javascript">
window.onload=init;
function init()...{
div1=document.getElementById("wc1")
div2=document.getElementById("wc2")
button1=document.getElementById("show_wc1")
button2=document.getElementById("show_wc2")
add(div1,button1)
add(div2,button2)
}
function add(o,p)...{
o.style.display="block";
o.top=p.offsetTop+p.offsetHeight;
o.left=p.offsetLeft+Math.ceil(p.offsetWidth/2);
o.style.left=parseInt(o.left)-Math.ceil(o.offsetWidth/2)
o.style.top=o.top
o.width = (o.offsetWidth) / 20;
o.height = (o.offsetHeight) / 20;
o.num = 0;
o.style.width=0;
o.style.height=0
o.style.display="none";
p.onmouseover=o.onmouseover=function()...{move(o)};
p.onmouseout=o.onmouseout=function()...{out(o)};
}
function move(o)...{
window.clearTimeout(o.time)
window.status=o.num
if (++o.num<=20)...{
o.style.display="block";
o.style.width=(o.num * o.width) + "px";
o.style.height=(o.num * o.height) + "px";
o.style.left=parseInt(o.left)-(o.offsetWidth/2)
o.clear=window.setTimeout(move, 10, o);
}
else...{
window.clearTimeout(o.clear);
}
}
function out(o)...{
window.clearTimeout(o.clear)
window.status=o.num
if(--o.num>=0)...{
o.style.width=(o.num * o.width) + "px";
o.style.height=(o.num * o.height) + "px";
o.style.left=parseInt(o.left)-(o.offsetWidth/2)
o.time=window.setTimeout(out, 10, o);
}
else...{
o.style.display="none"
window.clearTimeout(o.time);
}
}
(function () ...{
var timeout = window.setTimeout;
window.setTimeout = function (a, b) ...{
var fun;
if ("function" == typeof a) ...{
var arg = Array.prototype.slice.call(arguments, 2);
fun = function () ...{
a.apply(null, arg);
};
} else ...{
fun = a;
}
return timeout(fun, b);
};
})();
</script>
- js源码--动态层
- js源码--动态层
- js源码--层动态变化
- js动态效果拖动层排序
- Js代码动态移动层-拖动浮层并关闭
- 【源码】一个动态日历的JS
- js浮动弹出层定位的问题,有源码
- js实现根据下拉列表动态改变其他层
- arcgis for js动态加载图层方法
- JS - 动态创建2维数组Array (例子源码)
- 实例讲解Ext Js生成动态树,附源码
- 利用JS弹出层实现简单的动态提示“正在加载中,请稍等...”
- js动态创建div层,鼠标悬停显示隐藏div(无闪烁+小三角)
- 利用JS弹出层实现简单的动态提示“正在加载中,请稍等...
- 数据连接层源码
- STKFramework层源码解析
- RIL层源码分析
- RIL层源码分析
- 算法效率的度量和存储空间需求
- C# 采集代码
- 深入解析ASP.NET架构
- 人力资源管理系统开发过程各阶段交付文档列表
- 线性表的类型定义
- js源码--动态层
- 加载设计器时遇到一个或多个错误。这些错误在下面列出。一些错误可通过重新生成项目来修复,而另一些错误则需要更改代码。
- 少年黑客连续攻陷666网站
- 数据库---存储过程总结
- 基金投资应树立的五种新理念
- 设计模式学习笔记(十五)——结构型模式总结
- asp.net常用js
- 能打开任何文件的API函数ShellExecute
- 重回战场