Exquisite loading progress bar

Source: Internet
Author: User

<HTML>
<Head>
<SCRIPT type = text/JavaScript>
<! --

VaR ie5 = (document. All & document. getelementsbytagname );
VaR step = 0;
Function setsb (v, El, inforel, message ){
If (ie5 | document. readystate = "complete "){
Filterel = El. Children [0];
Valueel = El. Children [1];

If (filterel. style. pixelwidth> 0 ){
VaR filterbackup = filterel. style. filter;
Filterel. style. Filter = "";
Filterel. style. Filter = filterbackup;
}

Filterel. style. width = V + "% ";
Valueel. innertext = V + "% ";
Inforel. innertext = message;
}
}
Function setsbbystep (v, El, inforel, message ){
If (ie5 | document. readystate = "complete "){
Step = Step + V;
Filterel = El. Children [0];
Valueel = El. Children [1];

If (filterel. style. pixelwidth> 0 ){
VaR filterbackup = filterel. style. filter;
Filterel. style. Filter = "";
Filterel. style. Filter = filterbackup;
}

Filterel. style. width = Step + "% ";
Valueel. innertext = Step + "%"
Inforel. innertext = message;
}
}
Window. onload = new function ("setsb (100, Sb, infor,/'page loaded /')")

Function fakeprogress (v, El ){
If (V & gt; = 100)
Setsb (100, El, infor, "Loading complete ");
Else {
Setsb (v, El, infor, "loading ...");
Window. setTimeout ("fakeprogress (" + (V + 1) + ", document. All [/'" + El. ID + "/'])", 100 );
}
}

// -->
</SCRIPT>
<! -- # Endeditable -->
</Head>
<Body bgcolor = "# ffffff" leftmargin = "20" topmargin = "20" onLoad = "fakeprogress (0, Sb)">
<! -- Status Bar starts -->
<Div id = sb
Style = "border-Right: White 2px inset; border-top: White 2px inset; Background: white; border-left: White 2px inset; width: 200px; border-bottom: white 2px inset; Height: 20px; text-align: Left ">
<Div id = sbchild1
Style = "filter: alpha (opacity = 0, finishopacity = 100, style = 1, startx = 0, starty = 0, finishx = 100, finishy = 0); width: 0%; position: absolute; Height: 16px ">
<Div
Style = "font-size: 1px; Background: highlight; width: 100%; Height: 100%"> </div>
</Div>
<Div
Style = "font-size: 12px; width: 100%; color: black; font-family: Arial; position: absolute; text-align: Center"> 0% </div>
</Div>
<! -- Status bar ends -->
<Div id = infor
Style = "font-size: 12px; width: 100%; color: black; font-family: Arial; position: relative; text-align: Center"> </div>
<Br>
<Button onclick = "fakeprogress (0, Sb)"> reload </button>
<! -- # Endeditable --> </div>
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.