| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 571 人关注过本帖
标题:进度条的执行问题
只看楼主 加入收藏
liu4396
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-8-1
收藏
 问题点数:0 回复次数:0 
进度条的执行问题

<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的时候,也能看到完整的渐进效果呢?

搜索更多相关主题的帖子: 进度 
2006-11-16 16:30
快速回复:进度条的执行问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015466 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved