本文實例講述了JS仿Windows開機啟動Loading進度條的方法。分享給大家供大家參考。具體實現方法如下:
代碼如下:<html>
<title>JS仿Windows開機啟動的Loading進度條</title>
</head>
<body style="margin:0;background-color:#5279CE;" scroll=no>
<table id=lw style="display:block;position:absolute;top:0;left:0;z-index:1;height:;width:" border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td width="100%" bgcolor="#5279CE" align="center"><font face="Wingdings" style="font-size:240px;color=#000000">Y</td>
</tr>
<tr>
<td height="10" bgcolor="#3F5FB2">
<SCRIPT language=jscript>
elt="0123456789ABCDEF";
var sTBHTMLS="";
var sTBHTMLE="";
for(var i=0;i<0xFF-0x99;i+=1)
{
var cr="";
var l;
var sTBHTML="";
l=i+0x99;
for(var j=0;j<2;j++)
{
var n=l % 16;
l=l >> 4;
cr=elt.charAt(n)+cr;
}
l=i+0x33;
for(var j=0;j<2;j++)
{
var n=l % 16;
l=l >> 4;
cr=elt.charAt(n)+cr;
}
l=i;
for(var j=0;j<2;j++)
{
var n=l % 16;
l=l >> 4;
cr=elt.charAt(n)+cr;
}
var w=i>(0xFF-0xA0)?8:4
sTBHTML="<span style='height:10;width:"+w+";background-color:#"+cr+";margin:0;padding:0'></span>"
sTBHTMLS+=sTBHTML;
sTBHTMLE=sTBHTML+sTBHTMLE;
}
var sTBHTML=sTBHTMLS+sTBHTMLE;
document.write("<marquee id='loading' scrollamount='30' direction='right' scrolldelay='1' height='4' style='width:100%;height:10; font-size:6px;background-color:#003399'>")
document.write(sTBHTML)
document.write("</marquee>")
</SCRIPT></td>
</tr>
<tr>
<td width="100%" height="20%" bgcolor="#ECF0FF"><center><span id=load_txt style="font-size:12px;"><b id=showtxt style="color:red;font-size:12px;line-height:138%;">載入中,請稍候……</b></span></center>
<p align="center" style="font-size:9pt;">CopyRight@</p></td>
</tr>
</table>
<SCRIPT LANGUAGE="JavaScript">
<!--
var finderror = false;
function gopage()
{
if(document.readyState=="complete")
{
showtxt.innerHTML="載入中,請稍候……"
loading.style.display="none";
}
}
//-->
</SCRIPT>
</body>
</html>
希望本文所述對大家的javascript程序設計有所幫助。