加遮盖层

/**加遮盖层**/
function screenPage()
{
var isIe=(document.all)?true:false;
var bWidth=parseInt(document.documentElement.scrollWidth);
var bHeight=parseInt(document.documentElement.scrollHeight);
var back;
if(document.getElementById('back')==null){
back=document.createElement("div");
back.id="back";
var styleStr="top:0px;left:0px;position:absolute;background:#666;width:"+bWidth+"px;height:"+bHeight+"px;";
styleStr+=(isIe)?"filter:alpha(opacity=40);":"opacity:0.40;";
back.style.cssText=styleStr;
document.all.tab1.appendChild(back);
}else{
back=document.getElementById('back');
document.getElementById('back').style.display="block";
}

}
/**去掉遮盖层**/
function cancelScreenPage()
{
if(document.getElementById('back')!=null)
{
//document.getElementById('back').parentNode.removeChild(document.getElementById('back'));
//document.getElementById('back').style.display="none";
document.getElementById('tab1').removeChild(document.getElementById('back'));
}
}

你可能感兴趣的:(加遮盖层)