日期:2014-05-16  浏览次数:20404 次

js进度条效果
javascript 前端进度条效果<title>网页loading</title>
<script language="javascript">
  function setSB(v, el) {
    var ie5 = (document.all  &&  document.getElementsByTagName);
    if (ie5 || document.readyState == "complete")     {
      filterEl = el.children[0];
      valueEl = el.children[1];
      filterEl.style.width = v + "%";
      valueEl.innerText = v + "%";
    }
  }
  function fakeProgress(v, el) {
    if (v > 100)
      location.href = "/";
    else     {
      setSB(v, el);
      window.setTimeout("fakeProgress(" + (++v) + ", document.all['" + el.id + "'])", 20);
    }
  }
</script>
</head> 

<body onload="fakeProgress(0, sb)" topmargin=180 bgcolor=#CCCCCC>
<center>
<p align=center style="font-szie:9pt; line-height: 100%">正在加载请稍侯……</p>
<span id=sb style="width: 500px">
<div style="filter: Alpha(Opacity=0, FinishOpacity=60, style=1, StartX=0, StartY=0, FinishX=100, FinishY=0); width: 0%; height: 12px; position: absolute; background: #9999ff"></div>
<div style="font-size: 12px; width: 100%; color: #ff3333; font-family: arial; text-align: center"></DIV>
</span>
</center>
</body>
</html>














<html xmlns="http://schemas.microsoft.com/intellisense/html-401">
<head>
    <title>一个JS做的相当漂亮的进度条</title>
</head>
<body>  
</body>
<script type="text/jscript">
function DoubleAnimation(target,targetProperty,from,to,Duration)
{
    this.Begin=function anonymous()
    {
        target[targetProperty]=from;
        var starttime=new Date();
        setTimeout(StoryBoard(),1);
        function StoryBoard()
        {
            return function()
            {                
                var now=new Date();
                var d=now.getTime()-starttime.getTime();
                target[targetProperty]=Math.round(from+(to-from)*d/Duration);
                if(d<Duration)setTimeout(StoryBoard(),10);
            }
        }
    }
    this.setTo=function(val){to=val;}
    this.setFrom=function(val){from=val;}
}
function ProgressBar(ID)
{
    document.write( "<div id=\""+ID+"\" style=\"position:absolute;top:10%;width:100; left: 108px;\">        <image src=\"http://www.qpsh.com/icon/emptypb.jpg\" style=\"position: absolute;left: 84px; top: 13