写了一个打开窗口拉幕的效果(上下型) 演示地址:http://www.phpfine.com/lamu.htm
<html>
<head>
<title>实现拉幕效果(上下型)</title>
<style>
<!--
.hlb{position:absolute;
left:0;
top:0;
height:0;
background-color:#72DADA;
border:0.1px solid green
}
-->
</style>
<script language="JavaScript">
//此程序仅对ie有效
//变量初始化
function init()
{
if (document.all)
{
onflag=0;
speed=20;
temp=new Array();
clipbottom=document.body.offsetHeight;
cliptop=0;
for (i=1;i<=8;i++)
{
temp[i]=eval("document.all.h"+i+".style")
temp[i].width=document.body.clientWidth/8
temp[i].height=0;
temp[i].left=(i-1)*parseInt(temp[i].width)
}
}
}
function discolor(){
speed+=20;
for(i=1;i<=8;i++){
temp[i].height=speed;
}
DisId=setTimeout("discolor()",100);
if(speed>=document.body.offsetHeight){
clearTimeout(DisId);
onflag=1;
speed=20;
}
}
//实现拉幕效果(上下型)
function openit()
{
//window.scrollTo(0,0)
if (document.all&&onflag==1)
{
clipbottom-=speed;
for (i=1;i<=8;i=i+2)
{
temp[i].clip="rect(0 auto "+clipbottom+" 0)"
}
cliptop+=speed
for (i=2;i<=8;i=i+2)
{
temp[i].clip="rect("+cliptop+" auto auto auto)"
}
if (clipbottom<=0)
clearInterval(stopit);//到顶的时候要据时间id清除掉
}
stopit=setTimeout("openit()",100);
}
//
</script>
</head>
<body onload="init();discolor();openit()" >
<div id="h1" class="hlb"></div>
<div id="h2" class="hlb"></div>
<div id="h3" class="hlb"></div>
<div id="h4" class="hlb"></div>
<div id="h5" class="hlb"></div>
<div id="h6" class="hlb"></div>
<div id="h7" class="hlb"></div>
<div id="h8" class="hlb"></div>
</body>
</html>
[此贴子已经被作者于2007-8-29 22:53:28编辑过]