ASP上传文件进度条问题
- 提问者网友:鐵馬踏冰河
- 2021-05-07 05:34
- 五星知识达人网友:英雄的欲望
- 2021-05-07 06:28
我来看你咯;
我只是路过来顺便踩下.你的问题太复杂我回答不了....不好意思...
本回答来自安徽集团成员回答 谢谢合作 希望你们可以采纳 欢迎加入本团!!如有打扰 请见谅!!
- 1楼网友:纵马山川剑自提
- 2021-05-07 07:26
这是我在网上找的一个,还可以.先建立一个JS文件,加入以下代码:
//********************
AddProcessbar(); var bwidth=0; var swidth = document.all.waiting.clientWidth;
function CheckIsProcessBar(obj) { if (obj.IsShowProcessBar=="True") { return false; } else { return true; } }
function CheckClick(e) { if (e == 1) { if (bwidth<swidth*0.98){ bwidth += (swidth - bwidth) * 0.025; if (document.all)document.sbar.width = bwidth; else document.rating.clip.width = bwidth; setTimeout('CheckClick(1);',150);
} } else { if(document.all) { if(document.all.waiting.style.visibility == 'visible') {document.all.waiting.style.visibility = 'hidden'; bwidth = 1;} whichIt = event.srcElement;
while (CheckIsProcessBar(whichIt)) { whichIt = whichIt.parentElement; if (whichIt == null)return true; }
document.all.waiting.style.pixelTop = (document.body.offsetHeight - document.all.waiting.clientHeight) / 2 + document.body.scrollTop; document.all.waiting.style.pixelLeft = (document.body.offsetWidth - document.all.waiting.clientWidth) / 2 + document.body.scrollLeft; document.all.waiting.style.visibility = 'visible'; if(!bwidth)CheckClick(1); bwidth = 1;
}
else {
if(document.waiting.visibility == 'show') {document.waiting.visibility = 'hide'; document.rating.visibility = 'hide'; bwidth = 1;} if(e.target.href.toString() != '') { document.waiting.top = (window.innerHeight - document.waiting.clip.height) / 2 + self.pageYOffset; document.waiting.left = (window.innerWidth - document.waiting.clip.width) / 2 + self.pageXOffset; document.waiting.visibility = 'show'; document.rating.top = (window.innerHeight - document.waiting.clip.height) / 2 + self.pageYOffset+document.waiting.clip.height-10; document.rating.left = (window.innerWidth - document.waiting.clip.width) / 2 + self.pageXOffset; document.rating.visibility = 'show'; if(!bwidth)CheckClick(1); bwidth = 1; } } return true; } }
function AddProcessbar() {
var Str="" Str+= "<div id=waiting ; Str+= "<layer name=waiting visibility=visible zIndex=2 >" Str+= "<table border=2 cellspacing=1 cellpadding=0 bordercolorlight=#FFFFFF bordercolordark=#C0C0C0 bgcolor=#E0E0E0>" Str+= " <tr>" Str+= " <td bgcolor=#E0E0E0 height=30px width=300px align=center>" Str+= " <font color=black>系统正在处理中...</font>" Str+= " </td>" Str+= " </tr>" Str+= " <tr>" Str+= " <td bgcolor=#E0E0E0>" Str+= " <img width=1 height=10 name=sbar Str+= " </td>" Str+= " </tr>" Str+= "</table> " Str+= "</layer>" Str+= "</div>" document.write(Str)
if(document.all)document.onclick = CheckClick; }
//*******完******
调用:
<input type="submit" name=Submit id=Submit value="开始" onclick="window.location='/zzcs.asp';" IsShowProcessBar="True">或者
<a href="/admin/toly.asp" IsShowProcessBar="True">开始</a>
你试试看行不行