<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gbk">
<Title> Flash DownLoad control example </title>
<Meta name = "MSSmartTagsPreventParsing" content = "TRUE">
<Meta http-equiv = "MSThemeCompatible" content = "Yes">
<Style type = "text/css">
Body {
Scrollbar-base-color: # F5FBFF;
Scrollbar-arrow-color: #86B9D6;
Font: 12px Tahoma, Verdana;
Background-color: # FFFFFF;
Color: #333333;
}
Table {
Font: 12px Tahoma, Verdana;
Color: #333333;
Empty-cells: show;
Border-collapse: separate! Important;
Border-collapse: collapse;
}
Input, select, textarea {
Font: 12px Tahoma, Verdana;
Color: #333333;
Font-weight: normal;
Background-color: # F5FBFF;
Border: 1px solid # 7AC4EA;
}
Input {
Height: 21px;
}
A {
Text-decoration: none;
Color: #154BA0;
}
A: hover {
Text-decoration: underline;
}
. Checkbox,. radio {
Border: 0px;
Background: none;
Vertical-align: middle;
Height: 16px;
}
</Style>
</Head>
<BODY>
<Script Language = "JavaScript">
/*************************************** *****************
* ProgressBar class
* @ Author null
* @ Param width-width of progress bar
* @ Param height-height of progress bar
* @ Param fgColor-fgColor of progress bar
* @ Param bgColor-bgColor of progress bar
* @ Param borderColor-borderColor of progress bar
The rule is the same border-color of CSS
/*************************************** *****************/
Function ProgressBar (width, height, fgColor, bgColor, borderColor ){
If (borderColor = undefined ){
BgColor = "threedlightshadow ";
FgColor = "highlight ";
BorderColor = "buttonshadow window buttonshadow ";
}
Else if (borderColor = undefined & fgColor = undefined & bgColor = undefined ){
BgColor = "threedlightshadow ";
FgColor = "highlight ";
BorderColor = "buttonshadow window buttonshadow ";
}
Percent = 0.0; // initialize to zero
FontSize = Math. ceil (height/2) + 1;
Font_bt = "<table width = 100% height = 100% cellpadding = 0 cellspacing = 0 style = 'font: bold" + fontSize + "px Arial; color:" + bgColor + "; text-align: center; vertical-align: center; '& gt; <tr> <td> "+ parseInt (percent * 100) + "% </td> </tr> </table> ";
Font_ft = "<table width = 100% height = 100% cellpadding = 0 cellspacing = 0 style = 'font: bold" + fontSize + "px Arial; color:" + fgColor + "; text-align: center; vertical-align: center; '& gt; <tr> <td> "+ parseInt (percent * 100) + "% </td> </tr> </table> ";
Squares = "";
For (var I = 0; I ++ ){
Varleft = width-2-i * (height/2 + 1 );
// Alert (left );
If (left> = height/2 + 1 ){
Squares + = "<span style = 'background-color:" + fgColor + "; width:" + height/2 + "px; height:" + (height-2) + "; margin-right: 1px; '> </span> ";
}
Else if (left> = 1 ){
Squares + = "<span style = 'background-color:" + fgColor + "; width:" + left + "px; height:" + (height-2) + "; margin: 0px; '> </span> ";
}
Else
Break;
}
// Position: absolute;
Str = "<span id = progress_bg style = 'width:" + width + "px; height:" + height + "px; background-color:" + bgColor + "; border: 1px solid; border-color: "+ borderColor +" '> "; //" + fgColor + "# transparent
Str + = "<span id = progress_fg style = 'position: absolute; width: 100%; height: 100%; clip: rect (0," + parseInt (percent * 100) + "%, 100%, 0); background-color:" + fgColor + "; font-size: 0px; line-height: 0px; '> ";
Str + = squares;
Str + = "</span> ";
Str + = "<span id = progress_bt style = 'position: absolute; z-index: 8; width: 100%; height: 100%; background-color: # transparent; clip: rect (0, "+ parseInt (percent * 100) +" %, 100%, 0); text-align: center; '> ";
Str + = font_bt;
Str + = "</span> ";
Str + = "<span id = progress_ft style = 'position: absolute; z-index: 9; width: 100%; height: 100%; background-color: # transparent; clip: rect (0,100%, 100%, "+ parseInt (percent * 100) +" %); text-align: center; '> ";
Str + = font_ft;
Str + = "</span> ";
Str + = "</span> ";
Document. write (str );