不可以真正实现进度条但是,可以在页面加载前,到加载完成期间出现提示,用jshttp://www.hrcn.cn

解决方案 »

  1.   

    呵呵~~用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>
    进度条颜色、执行时间等参数可以自己修改
      

  2.   

    xylegend(晓逸) 的方法是有个进度条,但是这个查询是不定的,有可能很长时间,有可能很短时间,可不可以根据查询的实际情况来产生进度指示?
      

  3.   

    http://fason.nease.net/真实进度条
      

  4.   

    <HTML>
    <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>
      

  5.   

    http://fason.nease.net/效果真好,可是代码真是长,看得头都大了。
    swich(学无纸尽) 的效果也很好。
      

  6.   

    再加一句,swich(学无纸尽) 的效果是不是先显示进度条效果,再载入页面?那好象这个进度指示没起到作用吧。
      

  7.   

    http://bbs.kfc.net.ru/index.php?showtopic=20
      

  8.   

    呵呵 用FLASH 和 XML做一个?