使用Flash DownLoad编写采集器(之突破防盗连下载音乐文件)第1/4页
程序员文章站
2022-06-15 15:45:26
<!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 下载控件示例</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 window buttonshadow";
}
else if(bordercolor==undefined&&fgcolor==undefined&&bgcolor==undefined){
bgcolor = "threedlightshadow";
fgcolor = "highlight";
bordercolor = "buttonshadow window 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;'><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;'><tr><td>"+parseint(percent*100)+" %</td></tr></table>";
squares = "";
for(var i=0;;i++){
var left = 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);
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gbk">
<title>flash download 下载控件示例</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 window buttonshadow";
}
else if(bordercolor==undefined&&fgcolor==undefined&&bgcolor==undefined){
bgcolor = "threedlightshadow";
fgcolor = "highlight";
bordercolor = "buttonshadow window 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;'><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;'><tr><td>"+parseint(percent*100)+" %</td></tr></table>";
squares = "";
for(var i=0;;i++){
var left = 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);
1
上一篇: 完美解决ASP 不能更新。数据库或对象为只读。 原创
下一篇: jsp乱码问题收集