web页面加载时显示加载状态

1. 加载进度条
           Response.Write("<div id='mydiv' >");
           Response.Write("_");
           Response.Write("</div>");
           Response.Write("<script>mydiv.innerText = '';</script>");
           Response.Write("<script language=javascript>;");
           Response.Write("var dots = 0;var dotmax = 10;function ShowWait()");
           Response.Write("{var output; output = '页面正在载入,请稍后';dots++;if(dots>=dotmax)dots=1;");
           Response.Write("for(var x = 0;x < dots;x++){output += '·';}mydiv.innerText =  output;}");
           Response.Write("function StartShowWait(){mydiv.style.visibility = 'visible'; ");
           Response.Write("window.setInterval('ShowWait()',1000);}");
           Response.Write("function HideWait(){mydiv.style.visibility = 'hidden';");
           Response.Write("window.clearInterval();}");
           Response.Write("StartShowWait();</script>");
           Response.Flush();
           Response.Write("<script language=javascript>HideWait();</script>");

2. 加载进度框

            Response.Write("<script language=javascript>var win;win=window.open('_layouts/bluetech/loading.htm','progress','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=270,height=201,screenX='+(screen.width-270)/2+',screenY='+(screen.height-201)/2+',top='+(screen.height-201)/2+',left='+(screen.width-270)/2+'');</script>");
            Response.Flush();
            Response.Write("<script language=javascript>win.close();</script>");
posted @ 2007-01-09 11:33  '.Elvis.'  阅读(1324)  评论(0编辑  收藏  举报