在线问大家一个进度条的问题,马上结

devinjiang 2004-05-13 07:37:14
我的表单提交后,总是在老页面上停一段时间
我想要点提交后马上能进入等待页面(不用进度条也可以)
等加载好后再切换到结果上
希望有兄弟姐妹给我一个例子。
着急啊!

就象这个网站查询的等待页面一样 www.yoee.com
...全文
120 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
lovedevin 2004-05-14
  • 打赏
  • 举报
回复
<%
Response.Write "<span id=loadImg name=loadImg><TABLE WIDTH=100% height=80% BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD align=middle>"
Response.Write "<IMG SRC='../images/loading1.gif' name=Img>"
Response.Write "</TD></TR></TABLE></span>"
Response.Flush
%>
<SCRIPT LANGUAGE=javascript>
<!--
loadImg.style.display="none";
//-->
</SCRIPT>

把这段代码放在页首



在页面中加入如下代码即可实现下载百分比
<SCRIPT language=VBScript>
<!--
Dim Bar, Line, SP
Bar = 0
Line = "|"
SP = 100
Function Window_onLoad()
Bar = 95
SP = 10
End Function
Function Count()
If Bar < 100 Then
Bar = Bar + 1
Window.Status = "页面载入状态:" & Bar & "%" & " " & String(Bar, Line)
setTimeout "Count()", SP
Else
Window.Status = "页面载入状态:完成!"
Document.Body.Style.Display = ""
End If
End Function
Call Count()
-->
</SCRIPT>
lawdoor 2004-05-13
  • 打赏
  • 举报
回复
http://fason.nease.net/

<style>
body {margin:0px;}
.loading {position:absolute;width:200;height:100px;border:1px solid 3366CC;z-index:1000;}
.main {width:100%;height:100%;visibility:hidden;}
</style>
<body>
<iframe name="load" id="loading" class="loading" frameborder=0 scrolling="no"></iframe>
<iframe name="default" id="IndexPage" class="main" frameborder=0 src="about.htm"></iframe>
<script language="JavaScript">
var loadobj = document.getElementById("loading");
var mainobj = document.getElementById("IndexPage");
var loadFrm = window.frames["load"].document;
var mainFrm = window.frames["default"].document;
var l = (document.body.clientWidth - loadobj.offsetWidth)/2;
var t = (document.body.clientHeight - loadobj.offsetHeight)/2;
with(loadobj.style){left=l;top=t;};
var loadHtml = '<body bgcolor="#d2e8FF"><center><img src="http://fason.nease.net/img/Loading.gif></center></body>';
loadFrm.write(loadHtml);
mainFrm.onreadystatechange=function() {
if(mainFrm.readyState=="complete") {
loadobj.style.visibility="hidden";
mainobj.style.visibility="visible";
}
}
</script>
</body>
lawdoor 2004-05-13
  • 打赏
  • 举报
回复
<form name=loading>
<p align=center> <font color="#0066ff" size="2">载入中,请稍等</font><font
color="#0066ff" size="2" face="Arial">...</font><br>
<input type=text name=chart size=46 style="font-family:Arial;
font-weight:bolder; color:#0066ff; background-color:#fef4d9; padding:0px;
border-style:none;">
<br>
<input type=text name=percent size=47 style="color:#0066ff;
text-align:center; border-width:medium; border-style:none;">
<script>
var bar=0
var line="||"
var amount="||"
count()
function count(){
bar=bar+2
amount =amount + line
document.loading.chart.value=amount
document.loading.percent.value=bar+"%"
if (bar<99)
{setTimeout("count()",100);}
else
{window.location = "#";}
}</script>
</p>
</form>
lawdoor 2004-05-13
  • 打赏
  • 举报
回复
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
#bar, #barbackground{
position:absolute;
left:0;
top:0;
background-color:blue;
}

#barbackground{
background-color:black;
}

-->
</style>

<script language="JavaScript1.2">

/*
Dynamic Progress Bar- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

//1) Set the duration for the progress bar to complete loading (in seconds)
var duration=5

//2) Set post action to carry out inside function below:
function postaction(){
//Example action could be to navigate to a URL, like following:
//window.location="http://www.dynamicdrive.com"
}


///Done Editing/////////////
var clipright=0
var widthIE=0
var widthNS=0

function initializebar(){
if (document.all){
baranchor.style.visibility="visible"
widthIE=bar.style.pixelWidth
startIE=setInterval("increaseIE()",50)
}
if (document.layers){
widthNS=document.baranchorNS.document.barbackgroundNS.clip.width
document.baranchorNS.document.barNS.clip.right=0
document.baranchorNS.visibility="show"

startNS=setInterval("increaseNS()",50)
}
}

function increaseIE(){
bar.style.clip="rect(0 "+clipright+" auto 0)"
window.status="Loading..."
if (clipright<widthIE)
clipright=clipright+(widthIE/(duration*20))
else{
window.status=''
clearInterval(startIE)
postaction()
}
}

function increaseNS(){
if (clipright<202){
window.status="Loading..."
document.baranchorNS.document.barNS.clip.right=clipright
clipright=clipright+(widthNS/(duration*20))
}
else{
window.status=''
clearInterval(startNS)
postaction()
}
}


window.onload=initializebar
</script>
</head>
<script language="JavaScript1.2">
if (document.all){
document.write('<div id="baranchor" style="position:relative;width:200px;height:20px;visibility:hidden;">')
document.write('<div id="barbackground" style="width:200px;height:20px;z-index:9"></div>')
document.write('<div id="bar" style="width:200px;height:20px;z-index:10"></div>')
document.write('</div>')
}

</script>
<ilayer name="baranchorNS" visibility="hide" width=200 height=20>
<layer name="barbackgroundNS" bgcolor=black width=200 height=20 z-index=10 left=0 top=0></layer>
<layer name="barNS" bgcolor=blue width=200 height=20 z-index=11 left=0 top=0></layer>
</ilayer>
<body>

</body>
</html>
lawdoor 2004-05-13
  • 打赏
  • 举报
回复
1)
=============================================
<style type="text/css">
#divLoadCont{position:absolute; z-index:500; left:0; top:0; width:100%; height:98%; clip:rect(0,100%,100%,0); background-color:transparent; layer-background-color:white; }
#divLoad1{position:absolute; layer-background-color:silver; background-color:silver}
#divLoad2{position:absolute; left:0; top:0; layer-background-color:navy; background-color:navy}
#divLoadText{position:absolute; background-color:transparent; font-family:arial,helvetica; color:Navy; font-size:14px; }
</style>
<script language="JavaScript" type="text/javascript">
function lib_bwcheck(){ //Browsercheck (needed)
this.ver=navigator.appVersion
this.agent=navigator.userAgent
this.dom=document.getElementById?1:0
this.opera5=this.agent.indexOf("Opera 5")>-1
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
this.ie=this.ie4||this.ie5||this.ie6
this.mac=this.agent.indexOf("Mac")>-1
this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
return this
}
var bw=new lib_bwcheck()
numImages=20 //速度
loaderWidth=300 //进度条长度

currentImg=0
function lib_doc_size(){
this.x=0;this.x2=bw.ie && document.body.offsetWidth-20||innerWidth||0;
this.y=0;this.y2=bw.ie && document.body.offsetHeight-5||innerHeight||0;
if(!this.x2||!this.y2) return message('Document has no width or height')
this.x50=this.x2/2;this.y50=this.y2/2;
return this;
}
function lib_obj(obj,nest){
nest=(!nest) ? "":'document.'+nest+'.'
this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;
this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt;
this.ref=this.css
this.w=this.evnt.offsetWidth||this.css.clip.width||
this.ref.width||this.css.pixelWidth||0;
return this
}
lib_obj.prototype.moveIt = function(x,y){
this.x=x;this.y=y; this.css.left=x;this.css.top=y
}
lib_obj.prototype.clipTo = function(t,r,b,l,setwidth){
this.ct=t; this.cr=r; this.cb=b; this.cl=l
if(bw.ns4){
this.css.clip.top=t;this.css.clip.right=r
this.css.clip.bottom=b;this.css.clip.left=l
}else{
if(t<0)t=0;if(r<0)r=0;if(b<0)b=0;if(b<0)b=0
this.css.clip="rect("+t+","+r+","+b+","+l+")";
if(setwidth){this.css.pixelWidth=this.css.width=r;
this.css.pixelHeight=this.css.height=b}
}
}
var oLoad2
function startLoading(){
page=new lib_doc_size()
oLoadCont=new lib_obj('divLoadCont')
oLoad=new lib_obj('divLoad1','divLoadCont')
oLoad2=new lib_obj('divLoad2','divLoadCont.document.divLoad1')
oLoadText=new lib_obj('divLoadText','divLoadCont.document.divLoad1')
oLoad.moveIt(page.x50-loaderWidth/2,page.y50-20)
oLoadText.moveIt(loaderWidth/2 - oLoadText.w/2,10)
oLoad.clipTo(0,loaderWidth,40,0,1)
oLoad2.per = loaderWidth/numImages
}
function loadIt(ok){
currentImg++
if(oLoad2) oLoad2.clipTo(0,oLoad2.per*currentImg,40,0,1)
if(!ok){
oLoadCont.css.visibility='hidden'
oLoadCont=null; oLoad1=null; oLoad2=null;
}
}
function loadIt_display(ok){
currentImg++
if(oLoad2) oLoad2.clipTo(0,oLoad2.per*currentImg,40,0,1)
if(currentImg<=numImages) setTimeout("loadIt_display(1)",200)
else{
oLoadCont.css.visibility='hidden'
window.location="file:///c|/"
}
}
</script>
<div id="divLoadCont">
<div id="divLoad1">
<div id="divLoad2"></div><br>
<div id="divLoadText">Loading...</div>
</div>
</div>
<script>
startLoading()
//onload=loadIt; //- LEAVE THIS LINE WHILE TESTING. UNCOMMENT WHEN READY
loadIt_display(1) //LEAVE THIS LINE WHILE TESTING. DELETE WHEN READY
</script>
lawdoor 2004-05-13
  • 打赏
  • 举报
回复
<html>
<head>
<title> New Document </title>
<style>
<!--
#bar, #barbackground{
position:absolute;
left:0;
top:0;
background-color:blue;
}
#barbackground{
background-color:black;
}
-->
</style>
<script language="JavaScript1.2">
var duration=5
function postaction(){
}
var clipright=0
var widthIE=0
var widthNS=0
function initializebar(){
if (document.all){
baranchor.style.visibility="visible"
widthIE=bar.style.pixelWidth
startIE=setInterval("increaseIE()",50)
}
if (document.layers){
widthNS=document.baranchorNS.document.barbackgroundNS.clip.width
document.baranchorNS.document.barNS.clip.right=0
document.baranchorNS.visibility="show"

startNS=setInterval("increaseNS()",50)
}
}
function increaseIE(){
bar.style.clip="rect(0 "+clipright+" auto 0)"
window.status="Loading..."
if (clipright<widthIE)
clipright=clipright+(widthIE/(duration*20))
else{
window.status=''
clearInterval(startIE)
postaction()
}
}
function increaseNS(){
if (clipright<202){
window.status="Loading..."
document.baranchorNS.document.barNS.clip.right=clipright
clipright=clipright+(widthNS/(duration*20))
}
else{
window.status=''
clearInterval(startNS)
postaction()
}
}
window.onload=initializebar
</script>
</head>
<body bgcolor="#FFFFFF">
<script language="JavaScript1.2">
if (document.all){
document.write('<div id="baranchor" style="position:relative;width:200px;height:20px;visibility:hidden;">')
document.write('<div id="barbackground" style="width:200px;height:20px;z-index:9"></div>')
document.write('<div id="bar" style="width:200px;height:20px;z-index:10"></div>')
document.write('</div>')
}
</script>
<ilayer name="baranchorNS" visibility="hide" width=200 height=20>
<layer name="barbackgroundNS" bgcolor=black width=200 height=20 z-index=10 left=0 top=0></layer>
<layer name="barNS" bgcolor=blue width=200 height=20 z-index=11 left=0 top=0></layer>
</ilayer>
</body>
</html>
soso119 2004-05-13
  • 打赏
  • 举报
回复
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<table width=400 border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="border:1 solid black"><table id="tbl" width="1%" style="visibility:hidden" height="18" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#660099" id="td" style="color:white;"></td>
</tr>
</table></td>
</tr>
</table>
<input type="button" value=" 开 始 " onclick="doInit();doTask();">
<script language="JavaScript">
<!--
var p=1, IsCompleted=false
function doInit(){
p=1
IsCompleted=false
tbl.style.visibility = "hidden"
}
function doTask(){
var t=document.getElementById("tbl")
var td=document.getElementById("td")
if(p>=100){
p=100
IsCompleted=true
}
tbl.style.visibility = "visible"
tbl.width = p+"%"
td.innerText = p+"%"
if(p<100){
p+=1
setTimeout("doTask()",100)
}
}
function window.onbeforeunload()
{
if (!IsCompleted){
window.event.returnValue = "数据没有处理完成不能关闭"
}
}

//-->
</script>



</body>
</html>


lawdoor 2004-05-13
  • 打赏
  • 举报
回复
<script>
function loader()
{
var oDiv = document.createElement("div");
with(oDiv.style)
{
width = "99%";
padding = "1px 5px";
border = "1px solid #CC0099";
color = "window";
backgroundColor = "#3366cc";
font = "9pt Arial";
}
oDiv.noWrap = true;
oDiv.innerHTML = "<nobr>页面正在加载,请请候……长时间没有加载完毕请刷新!</nobr>"
document.body.insertBefore(oDiv,document.body.firstChild);
if(document.all)
{
window.attachEvent("onload",function(){ oDiv.parentNode.removeChild(oDiv);});
}
else
{
window.addEventListener("load",function(){ oDiv.parentNode.removeChild(oDiv);},false);
}
}
%>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧