快乐的程序员

博客园 首页 新随笔 联系 订阅 管理

var oDivProgressBarCount=0
    var oDivProgressBar=null;
    var isStopProgressBar=false;
   
    function ShowProgressBar()
    {     oDivProgressBar=document.createElement("DIV");
     oDivProgressBar.id="BtnExcuteoDivProgressBar";
     oDivProgressBar.innerHTML="<table border=0 cellspacing=0 cellpadding=0 align=left><tr><td height=20 width=0 bgcolor=blue></td></tr></table>";
     oDivProgressBar.style.border = "outset black 1px";
     oDivProgressBar.style.width=200;
     oDivProgressBar.style.height=20;
     oDivProgressBar.style.position='absolute';
     document.body.appendChild(oDivProgressBar);
     oDivProgressBar.style.left=(document.body.clientWidth-150)/2-20;
     oDivProgressBar.style.top=(document.body.clientHeight-50)/2;
     oDivProgressBar.style.display='';
     isStopProgressBar=false;
     GetBar();
    }
    function GetBar()
    { if(!isStopProgressBar)
     {
      oDivProgressBar.innerHTML="<table border=0 cellspacing=0 cellpadding=0 align=left><tr><td height=20 width="+(oDivProgressBarCount*10)+" bgcolor=blue></td></tr></table>";
      oDivProgressBarCount+=1;
      if(oDivProgressBarCount>20){oDivProgressBarCount=0;}
      isStopProgressBar=false;
      window.setTimeout(GetBar,100);
     }
    }
    function RemoveProgressBar()
    { isStopProgressBar=true;
     try{document.body.removeChild(document.getElementById("BtnExcuteoDivProgressBar"));}catch(e){}
    }

posted on 2008-03-17 17:11  Gram  阅读(1723)  评论(2编辑  收藏  举报