如何做一个进度条。 不可以真正实现进度条但是,可以在页面加载前,到加载完成期间出现提示,用jshttp://www.hrcn.cn 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 呵呵~~用JS确实不能反映真实的进度,只是一个视觉效果给你一个简单的例子:<form name="loading"> <input type="text" name="chart" size="46" style="font-family:Arial; font-weight:bolder; color:rgb(249,15,8); background-color:white; padding:0px; border-style:none;"> <br> <input type="text" name="percent" size="46" style="color:rgb(249,15,8); 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()",30);} else {} } </script> </form>进度条颜色、执行时间等参数可以自己修改 xylegend(晓逸) 的方法是有个进度条,但是这个查询是不定的,有可能很长时间,有可能很短时间,可不可以根据查询的实际情况来产生进度指示? http://fason.nease.net/真实进度条 <HTML><HEAD><META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"><TITLE></TITLE><SCRIPT LANGUAGE=javascript><!--var myTime=0function counter(){ myTime++ per.innerHTML="<font size=2 color=darkblue> "+myTime+"%</font>" if (myTime<100) setTimeout("counter()",40); else{ window.open("http://www.sina.com.cn"/;,null,"fullscreen=yes,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no") }}function window_onload() { counter()} //--></SCRIPT></HEAD><BODY LANGUAGE=javascript onload="return window_onload()"><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><table border="0" cellpadding="0" cellspacing="0" width="50%" align=center> <tr> <td width="51%" noWrap> <p align="right"><FONT face=宋体 color=navy size=2>正在加载:</FONT></p> </td> <td width="4%" bordercolor="#000000"> <marquee align="middle" direction="right" scrolldelay="1" bgcolor="gainsboro" scrollamount="2" style="BORDER-RIGHT: black 1px outset; BORDER-TOP: black 1px outset; FONT-SIZE: xx-small; BORDER-LEFT: black 1px outset; WIDTH: 133px; COLOR: #000080; BORDER-BOTTOM: black 1px outset; HEIGHT: 13px" behavior="slide" >███████████████████████████████████████████████████████████████████████████████</marquee> </td><td width="45%" align=left><div id=per></div></td> </tr></table></BODY></HTML> http://fason.nease.net/效果真好,可是代码真是长,看得头都大了。swich(学无纸尽) 的效果也很好。 再加一句,swich(学无纸尽) 的效果是不是先显示进度条效果,再载入页面?那好象这个进度指示没起到作用吧。 http://bbs.kfc.net.ru/index.php?showtopic=20 呵呵 用FLASH 和 XML做一个? php-无头冤尸... 为什么有的数据能插入,有的数据不能?好奇怪的问题 请问为什么对象是在页面加载完毕才销毁! PHP聊天群 关于页面切换时候的问题,怎么中断当前正在进行的操作? 安装apache后,不能打开测试页,怎么检查? php 处理视频文件的问题 这样的自动搜索程序怎么写? 请教一个很奇怪的smary问题 求apche重定向规则 1个SQL语句问题,请唠叨一下 关于array_walk()函数的使用疑惑
给你一个简单的例子:
<form name="loading">
<input type="text" name="chart" size="46" style="font-family:Arial; font-weight:bolder; color:rgb(249,15,8); background-color:white; padding:0px; border-style:none;"> <br>
<input type="text" name="percent" size="46" style="color:rgb(249,15,8); 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()",30);}
else
{}
}
</script>
</form>
进度条颜色、执行时间等参数可以自己修改
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT LANGUAGE=javascript>
<!--
var myTime=0
function counter(){
myTime++
per.innerHTML="<font size=2 color=darkblue> "+myTime+"%</font>"
if (myTime<100)
setTimeout("counter()",40);
else{
window.open("http://www.sina.com.cn"/;,null,"fullscreen=yes,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no")
}
}
function window_onload() {
counter()
} //-->
</SCRIPT>
</HEAD>
<BODY LANGUAGE=javascript onload="return window_onload()">
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P><table border="0" cellpadding="0" cellspacing="0" width="50%" align=center>
<tr>
<td width="51%" noWrap>
<p align="right"><FONT face=宋体 color=navy
size=2>正在加载:</FONT></p> </td>
<td width="4%" bordercolor="#000000">
<marquee align="middle" direction="right" scrolldelay="1" bgcolor="gainsboro" scrollamount="2" style="BORDER-RIGHT: black 1px outset; BORDER-TOP: black 1px outset; FONT-SIZE: xx-small; BORDER-LEFT: black 1px outset; WIDTH: 133px; COLOR: #000080; BORDER-BOTTOM: black 1px outset; HEIGHT: 13px"
behavior="slide"
>███████████████████████████████████████████████████████████████████████████████</marquee>
</td><td width="45%" align=left><div id=per></div></td>
</tr>
</table>
</BODY>
</HTML>
swich(学无纸尽) 的效果也很好。