提交数据时,用层覆盖父页面


<script LANGUAGE="JavaScript">
//提交数据时,用层覆盖父页面
function showCoverDiv(mark){
	var bodyObj=document.body;
	var dWidth=bodyObj.scrollWidth;
	var dHeight=bodyObj.scrollHeight;
	var tWidth=bodyObj.clientWidth;
	var tHeight=bodyObj.clientHeight;
	var filterStyle="FILTER:Alpha(opacity=10);position:absolute;";
	var coverDivBg="#EAF4FD";
	var ift="'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'";
	var coverHtml ='<div id="cover_div" style="'+filterStyle+';top:0;left:0;width:'+dWidth+';';
		coverHtml +='height:'+dHeight+';z-index:99998;background:'+coverDivBg+'">';
		coverHtml +='<iframe src="javascript:false" style="position:absolute; visibility:inherit; top:0px; left:0px; width:100%; height:100%; z-index:-1; filter='+ift+';"></iframe>';
		coverHtml +='</div>';
	var stmHtml ='<div id="stm_div" style="position:absolute;top:0;left:0;width:'+dWidth+';';
		stmHtml +='height:'+dHeight+';z-index:99999;">';
		stmHtml +='<table border="0" cellpadding="0" cellspacing="0" width="'+tWidth+'" height="'+tHeight+'">';
		stmHtml +='<tr valign="middle"><td align="center" id="coverTd">';
		stmHtml +='<span style="text-align:center;width:300px;height:60px;border:2px solid #25B4F0;padding-top:10px;background:#B9E7FA;">';
		stmHtml +='<font style="font-size:12px;">';
		if(mark=='loading'){
			stmHtml +='数据加载中...';
		}else{
			stmHtml +='正在提交数据到服务器,请等待...';
		}
		stmHtml +='</font><br><br><img src="./jdt.gif">';
		stmHtml +='</span>';
		stmHtml +='</td></tr></table>';
		stmHtml +='</div>';
	var coverDiv=document.createElement("div");
		coverDiv.setAttribute("id","base_c_div");
		bodyObj.insertBefore(coverDiv);
		coverDiv.style.display="block";
		coverDiv.innerHTML=coverHtml;
	var stmDiv=document.createElement("div");
		stmDiv.setAttribute("id","base_stm_div");
		bodyObj.insertBefore(stmDiv);
		stmDiv.style.display="block";
		stmDiv.innerHTML=stmHtml;
	setTimeout("hiddleCoverDiv()",120000);
}

//删除覆盖层
function removeCoverDiv(){
	var coverDiv=document.getElementById("base_c_div");
	var stmDiv=document.getElementById("base_stm_div");
	if(stmDiv!=undefined && stmDiv!=null){
		stmDiv.removeNode(true);
	}
	if(coverDiv!=undefined && coverDiv!=null){
		coverDiv.removeNode(true);
	}
}
 showCoverDiv();
</script>

你可能感兴趣的:(C++,c,Microsoft,C#)