模拟Windows升级页面特效
2005-03-21 21:59
381 查看
代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>模拟Windows升级页面特效</title>
</head>
<body>
<script language=javascript>
var BorderMove = new Object();
BorderMove.getx = function(tag)
{
x = tag.offsetLeft;
while(tag = tag.offsetParent)
{
x += tag.offsetLeft;
}
return x;
}
BorderMove.gety = function(tag)
{
y = tag.offsetTop;
while(tag = tag.offsetParent)
{
y += tag.offsetTop;
}
return y;
}
BorderMove.Init = function()
{
this.BeginWidth = window.document.body.offsetWidth;
this.BeginHeight = window.document.body.offsetHeight;
this.BeginLeft = window.document.body.offsetLeft;
this.BeginTop = window.document.body.offsetTop;
this.EndLeft = this.getx(this.toElementObj) + this.toElementObj.offsetWidth / 2;
this.EndTop = this.gety(this.toElementObj) + this.toElementObj.offsetHeight / 2;
this.TimeOut = 20;
this.MoveTime = 16;
this.Moved = 0
this.Distance = Math.sqrt(this.BeginLeft * this.BeginLeft + this.EndLeft * this.EndLeft);
this.MoveLeft = (this.EndLeft - this.BeginLeft) / this.MoveTime;
this.MoveTop = (this.EndTop - this.BeginTop) / this.MoveTime;
this.ContractWidth = this.BeginWidth / this.MoveTime;
this.ContractHeight = this.BeginHeight / this.MoveTime;
this.TimeOutId = null;
this.Div = window.document.createElement("DIV");
window.document.body.appendChild(this.Div);
}
BorderMove.Display = function(srcElementObjId,toElementObjId)
{
if(this.TimeOutId != null)
{
window.clearTimeout(this.TimeOutId);
window.document.body.removeChild(this.Div);
this.Div = null;
}
this.srcElementObj = window.document.getElementById(srcElementObjId);
this.toElementObj = window.document.getElementById(toElementObjId);
this.Init();
with(this.Div.style)
{
width = this.BeginWidth;
height = this.BeginHeight;
border = "1 dotted #cccccc";
position = "absolute";
left = this.BeginLeft;
top = this.BeginTop;
}
this.Move();
}
BorderMove.Move = function()
{
this.BeginWidth -= this.ContractWidth;
this.BeginHeight -= this.ContractHeight;
this.BeginLeft += this.MoveLeft;
this.BeginTop += this.MoveTop;
with(this.Div.style)
{
width = this.BeginWidth;
height = this.BeginHeight;
left = this.BeginLeft;
top = this.BeginTop;
}
this.Moved++;
if(this.Moved == this.MoveTime)
{
window.document.body.removeChild(this.Div);
this.Div = null;
this.Init();
}
else
{
this.TimeOutId = setTimeout("BorderMove.Move()",this.TimeOut);
}
}
</script>
<br><br><br><br><br><br><br><br>
<center><span id=Text>虚影目标对象</span></center>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<input type=button value="事件触发对象" onclick="BorderMove.Display(this.id,'Text')" id="Button">
</body>
</html>
[Ctrl+A 全选 提示:你可先修改部分代码,再点运行代码]
转自: http://goaler.xicp.net/Article/ShowArticle.asp?ID=471
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>模拟Windows升级页面特效</title>
</head>
<body>
<script language=javascript>
var BorderMove = new Object();
BorderMove.getx = function(tag)
{
x = tag.offsetLeft;
while(tag = tag.offsetParent)
{
x += tag.offsetLeft;
}
return x;
}
BorderMove.gety = function(tag)
{
y = tag.offsetTop;
while(tag = tag.offsetParent)
{
y += tag.offsetTop;
}
return y;
}
BorderMove.Init = function()
{
this.BeginWidth = window.document.body.offsetWidth;
this.BeginHeight = window.document.body.offsetHeight;
this.BeginLeft = window.document.body.offsetLeft;
this.BeginTop = window.document.body.offsetTop;
this.EndLeft = this.getx(this.toElementObj) + this.toElementObj.offsetWidth / 2;
this.EndTop = this.gety(this.toElementObj) + this.toElementObj.offsetHeight / 2;
this.TimeOut = 20;
this.MoveTime = 16;
this.Moved = 0
this.Distance = Math.sqrt(this.BeginLeft * this.BeginLeft + this.EndLeft * this.EndLeft);
this.MoveLeft = (this.EndLeft - this.BeginLeft) / this.MoveTime;
this.MoveTop = (this.EndTop - this.BeginTop) / this.MoveTime;
this.ContractWidth = this.BeginWidth / this.MoveTime;
this.ContractHeight = this.BeginHeight / this.MoveTime;
this.TimeOutId = null;
this.Div = window.document.createElement("DIV");
window.document.body.appendChild(this.Div);
}
BorderMove.Display = function(srcElementObjId,toElementObjId)
{
if(this.TimeOutId != null)
{
window.clearTimeout(this.TimeOutId);
window.document.body.removeChild(this.Div);
this.Div = null;
}
this.srcElementObj = window.document.getElementById(srcElementObjId);
this.toElementObj = window.document.getElementById(toElementObjId);
this.Init();
with(this.Div.style)
{
width = this.BeginWidth;
height = this.BeginHeight;
border = "1 dotted #cccccc";
position = "absolute";
left = this.BeginLeft;
top = this.BeginTop;
}
this.Move();
}
BorderMove.Move = function()
{
this.BeginWidth -= this.ContractWidth;
this.BeginHeight -= this.ContractHeight;
this.BeginLeft += this.MoveLeft;
this.BeginTop += this.MoveTop;
with(this.Div.style)
{
width = this.BeginWidth;
height = this.BeginHeight;
left = this.BeginLeft;
top = this.BeginTop;
}
this.Moved++;
if(this.Moved == this.MoveTime)
{
window.document.body.removeChild(this.Div);
this.Div = null;
this.Init();
}
else
{
this.TimeOutId = setTimeout("BorderMove.Move()",this.TimeOut);
}
}
</script>
<br><br><br><br><br><br><br><br>
<center><span id=Text>虚影目标对象</span></center>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<input type=button value="事件触发对象" onclick="BorderMove.Display(this.id,'Text')" id="Button">
</body>
</html>
[Ctrl+A 全选 提示:你可先修改部分代码,再点运行代码]
转自: http://goaler.xicp.net/Article/ShowArticle.asp?ID=471
相关文章推荐
- 模拟Windows升级页面特效
- 58种jQuery模拟CSS3过渡页面切换特效
- 模拟登陆WINDOWS认证的sharepoint页面
- 模拟windows 7特效小工具集合
- 58种jQuery模拟CSS3过渡页面切换特效
- 58种jQuery模拟CSS3过渡页面切换特效
- 重新想象 Windows 8 Store Apps (70) - 其它: 文件压缩和解压缩, 与 Windows 商店相关的操作, app 与 web, 几个 Core 的应用, 页面的生命周期和程序的生命周期
- 升级WINDOWS 10的失败
- oracle10.2.0.1升级到10.2.0.4oracle10.2.0.1升级到10.2.0.4(windows版本)
- IBM WebSphere Application Server Network Deployment 8.5.0.X 安装配置及补丁升级指南之Windows系统篇
- Android-模拟电视屏幕开关机特效
- 升级为域服务器- 体验Windows 2012 Server 的虚拟化技术【2】
- ionic版本从v1.0.0升级到v1.2.4后,android上使用<ion-content>的页面无法滑动
- 升级的革命:从Windows 2003到Windows 2008 推荐
- WIndows下AppAche服务中调试php页面出现警告:Call to undefined function mysql_connect()
- Windows Server CA升级
- CSS动画-页面特效
- Win10 禁止自动更新以及禁止Windows 10升级助手(Windows 10 易升)
- 纯JS焦点图特效(可一个页面多用)
- 推荐9款炫酷的基于jquery的页面特效