<html>
<head>
<title>LOADING</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv=pragma content=no-cache>
<meta http-equiv=Cache-Control content="no-cache, must-revalidate">
<meta http-equiv=expires content=0>
<script type=text/javascript>
function look(){
setSB(1000,"プロード",3099);
alert("aa");
setSB(2000,"アップロード",3099);
}
var ie5 = (document.all && document.getElementsByTagName);
function setSB(v, infor,totalSize) {
param1=v;
param2=totalSize;
percent = v /totalSize*100;
el = document.getElementById("sb");
filterEl = el.children[0];
valueEl = el.children[1];
if(percent<1){
percent=1;
}
filterEl.style.width = Math.round(percent) + "%";
valueEl.innerText = Math.round(percent) + "%";
if(percent==100){
document.getElementById("message").innerText = infor + "完了";
}
else {
document.getElementById("message").innerText = infor + "中...";
}
setTimeout("setSB2(param1+1000,'sssl',param2)",1000);
}
function setSB2(v, infor,totalSize) {
percent = v /totalSize*100;
el = document.getElementById("sb");
filterEl = el.children[0];
valueEl = el.children[1];
if(percent<1){
percent=1;
}
filterEl.style.width = Math.round(percent) + "%";
valueEl.innerText = Math.round(percent) + "%";
if(percent==100){
document.getElementById("message").innerText = infor + "完了";
}
else {
document.getElementById("message").innerText = infor + "中...";
}
}
</script>
</head>
<body >
<DIV align=center id=progressBar>
<DIV id=sb style="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; BACKGROUND: #DCDCDC; WIDTH: 400px; BORDER-BOTTOM: #cccccc 1px solid;HEIGHT: 20px; TEXT-ALIGN: left">
<DIV id=sbChild1 style="WIDTH: 0%; POSITION: absolute; HEIGHT: 18px;BACKGROUND: #000000;overflow:hidden">
</DIV>
<DIV style="FONT-SIZE: 16px; WIDTH: 400px; COLOR: white; FONT-FAMILY: arial;POSITION: absolute; HEIGHT: 20px; TEXT-ALIGN: center">
</DIV>
</DIV>
<p></p>
<DIV id="message" style="FONT-SIZE: 14px;WIDTH: 400px;HEIGHT: 20px;TEXT-ALIGN: center"></DIV>
<input type="button" name="ds" value="button" onClick="look()"/>
</DIV>
</body>
</html>
以上的look()方法中去掉alert("aa"),就看不到第一个setSB()执行效果了。怎么在不加alert的时候,也能看到完整的渐进效果呢?