|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
asp对于服务器的要求较高,一般的服务器如果访问量一大就垮了,不得不重启。前段工夫研讨了一个进度条,大抵的头脑是
在背景处置数据时,前台页面同时计数显现ProessBar
利用了layer来显现
用法:
1。援用
<scriptlanguage="javascript"src="ShowProcessBar.js"></script>
2。在提交Button或<A>或<span>加扩大属性
IsShowProcessBar="True"
文件ShowProcessBar.js以下
AddProcessbar();
varbwidth=0;
varswidth=document.all.waiting.clientWidth;
functionCheckIsProcessBar(obj)
{
if(obj.IsShowProcessBar=="True")
{
returnfalse;
}
else
{
returntrue;
}
}
functionCheckClick(e)
{
if(e==1)
{
if(bwidth<swidth*0.98){
bwidth+=(swidth-bwidth)*0.025;
if(document.all)document.sbar.width=bwidth;
elsedocument.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)returntrue;
}
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;
}
}
returntrue;
}
}
functionAddProcessbar()
{
varStr=""
Str+="<divid=waitingstyle=position:absolute;top:50px;left:100px;z-index:1;visibility:hidden>";
Str+="<layername=waitingvisibility=visiblezIndex=2>"
Str+="<tableborder=2cellspacing=1cellpadding=0bordercolorlight=#FFFFFFbordercolordark=#C0C0C0bgcolor=#E0E0E0>"
Str+="<tr>"
Str+="<tdbgcolor=#E0E0E0height=30pxwidth=300pxalign=center>"
Str+="<fontcolor=black>系y正在碇...</font>"
Str+="</td>"
Str+="</tr>"
Str+="<tr>"
Str+="<tdbgcolor=#E0E0E0>"
Str+="</script>
</HEAD>
<BODY>
<Ahref="error.asp"IsShowProcessBar="True">AHref</a>
<BR>
<BR>
<spanonclick="location.href=error.asp"style="cursor:hand"IsShowProcessBar="True"><fontcolor=blue>Span</font></span>
<BR>
<formaction="error.asp">
<inputtype=Submitvalue="Submit">
<inputtype=buttonvalue="normalbutton"IsShowProcessBar="True">
</form>
<PIsShowProcessBar="True">AAAAAAAAAAAAA</P>
</BODY>
</HTML>
</p>ASP是依赖组件的,能访问数据库的组件好多就有好多种,再有就是你微软的工具可是什么都要收钱的啊! |
|