天天看点

点击打开层并定时自动关闭JS代码

<script language="javascript"> 
function do_totals1()
{
document.all.pleasewaitScreen.style.pixelTop = (document.body.scrollTop + 50);
document.all.pleasewaitScreen.style.visibility="visible";
window.setTimeout('do_totals2()',1);
}
function do_totals2()
{
lengthy_calculation();
document.all.pleasewaitScreen.style.visibility="hidden";
}
function lengthy_calculation()
{
var x,y
for(x=0;x<1000000;x++)
{
y += (x * y) / (y - x);			
}
}
	
</script>
           

<DIV ID="pleasewaitScreen" STYLE="position:absolute;z-index:5;top:30%;left:42%;visibility:hidden">

<TABLE BGCOLOR="skyblue" BORDERCOLOR=black CELLPADDING="0" CELLSPACING="0" HEIGHT="80" WIDTH="136" ID="Table1">

<TR><TD BGCOLOR="silver" ALIGN="CENTER"><FONT COLOR="white"> 思维网</FONT></TD></TR></TABLE>

</DIV>

<p align="center"><a οnclick="do_totals1()">点这里</a></p>

继续阅读