去www.xici.net/main.asp看看,里面每打开一个超链都有进度条和广告,自己去里面问问或者用力找

解决方案 »

  1.   

    进度条的效果好做,就是隔一定时间把某个控件的尺寸加大一点
    但如何获得真正的下载进程就难了
    现在所见过的进度条(包括上面说的XICI的),都是利用定时器模拟的下面是我做的一个进度条“类”的简化版,仅供参考:<html>
    <head>
    <script>
    function CProgBar(iNo, iMax, sUnit, nWidth, nHeight, sFont, clBg, clBorder, clBar, clText)
    {
        this.iNo = iNo;
        this.iMax = iMax;
        this.sUnit = sUnit;
        this.nWidth = nWidth;
        this.nHeight = nHeight;
        this.sFont = sFont;
        this.clBg = clBg;
        this.clBorder = clBorder;
        this.clBar = clBar;
        this.clText = clText;
        this.iPos = 0;
        this.Init = CProgBar_Init;
        this.SetPos = CProgBar_SetPos;
        this.IncPos = CProgBar_IncPos;
    }
    function CProgBar_Init()
    {
        with ( this )
            document.write(
                '<div id=voProgBar_'+iNo+' style="position:relative;width:'+(nWidth+2)+'px;height:'+(nHeight+2)+'px;border:1px solid '+clBorder+';background:'+clBg+';font:'+(sFont?sFont:'1px')+'">'
                +'<div style="position:absolute;left:0px;top:0px;width:0px;height:'+nHeight+'px;background:'+clBar+'"></div>'
                +'<div style="position:absolute;left:0px;top:0px;width:'+nWidth+'px;height:'+nHeight+'px;color:'+clText+';text-align:center">0</div>'
                +'</div>'
            );
    }
    function CProgBar_SetPos(iNewPos)
    {
        with ( this )
        {
            var o = document.all.item('voProgBar_'+iNo).children;
            o(0).style.pixelWidth = Math.round(nWidth * iNewPos / iMax);
            if ( sFont) o(1).innerText = '' + iNewPos + sUnit;
            iPos = iNewPos;
        }    
    }
    function CProgBar_IncPos(nStep)
    {
        with ( this )
        {
            if ( iPos < iMax )
            {
                SetPos(iPos + nStep);
                return true;
            }
        }
        return false;
    }
    </script>
    </head>
    <body>
    <script>
    var oProgBar1 = new CProgBar(0, 100, '%', 400, 13, '10px Arial', '#bb0', '#f00', '#00f', '#fff');
    oProgBar1.Init();
    function incProgBar()
    {
        if ( oProgBar1.IncPos(1) )
            setTimeout("incProgBar();", 20); //每10毫秒加1,酌情设定
    }
    incProgBar();
    </script><br>简单的也可以考虑用<input type=text>
    <br>一个字符代表10%,10个字符代表100%等
    </body>
    </html>
      

  2.   

    <html>
    <head>
    <title></title>
    </head>
    <body>
    <table width=100% height=100% >
    <tr>
    <td valign=middle align=center width=100% height=100% >
    <form name=loading>
    <p><font color="7285CF">正在载入首页,请稍候.......</font></p>
    <p> 
    <input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:7285CF; background-color:white; padding:0px; border-style:none;">
    <br>
    <input type=text name=percent size=46 style="font-family:Arial; color:FF0000; 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 = "index.html" ; //填写跳转地址
    }
    }
    </script>
    </p>
    </form>
    </td>
    </tr>
    </table>
    </body>
    </html>
      

  3.   

    在 setTimeout 里可以根据当前页面大小来决定进度条的速度....setTimeout("incProgBar();", parseInt(document.fileSize)/100);
      

  4.   

    http://support.persits.com/upload/progress.asp
      

  5.   

    Progress Bar Control:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/progbar/progbar.asp
      

  6.   

    net_lover(孟子E章)找到的就是我刚找到的一种啦。也好合适你的要求。