//显示等待界面 function DisableTopHorseBGDivBeforeOnLoad() { var sWidth,sHeight,sWidth1,sHeight1; sWidth=document.body.offsetWidth;//浏览器工作区域内页面宽度 sHeight=document.body.offsetHeight;//屏幕高度(垂直分辨率) sWidth1=document.body.scrollWidth;//网页正文全文宽 sHeight1=document.body.scrollHeight;//网页正文全文高 //背景层(大小与窗口有效区域相同,即当弹出对话框时,背景显示为放射状透明灰色) var bgObj=document.getElementById("TopHorseBGDivBeforeOnLoad");//创建一个div对象(背景层) bgObj.style.width=sWidth1 + "px"; bgObj.style.height=sHeight1 + "px"; bgObj.style.display=""; //动态图片 var bgImageObj=document.getElementById("TopHorseWaitBeforeOnLoad");// bgImageObj.style.left=(sWidth-100)/2; bgImageObj.style.top=(sHeight-100)/2; bgImageObj.style.display=""; } //显示等待界面,显示多少毫秒 function TopHorseShowWaitForm(showtime) { //显示界面 DisableTopHorseBGDivBeforeOnLoad(); //隐藏界面 setTimeout("TopHorseHideDiv()",showtime); } //隐藏 function TopHorseHideDiv() { document.getElementById('TopHorseBGDivBeforeOnLoad').style.display='none'; document.getElementById('TopHorseWaitBeforeOnLoad').style.display='none'; } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } DisableTopHorseBGDivBeforeOnLoad();