以下是建立盖层,如何删除啊?刚接触这个不太明白,希望能说详细点。function $(id){return document.getElementById(id);}function ob_hid(id,flag){if($(id)) $(id).style.display=(flag)?'none':'block';}//这里用来建立和取消层的function nextok()
{
var bz=document.compatMode=="CSS1Compat"?document.documentElement:document.body;
if(!$('ndiv'))
{
var bd=document.getElementsByTagName("body").item(0);
var obnew=document.createElement('div');
obnew.setAttribute('id','ndiv');
obnew.className='test';
bd.appendChild(obnew);
var ht1=bz.scrollHeight,ht2=bz.clientHeight;
obnew.style.height=((ht1>ht2)?ht1:ht2)+"px";
if(!$('mdiv'))
{
var obnew=document.createElement('iframe');
obnew.setAttribute('id','mdiv');
obnew.className='test1';
bd.appendChild(obnew);
}
}
ob_hid('ndiv');ob_hid('mdiv');
$('mdiv').style.top=bz.scrollTop+(bz.clientHeight-$('mdiv').offsetHeight)/2+'px';
$('mdiv').style.left=((bz.clientWidth-$('mdiv').offsetWidth)/2+15)+'px';
}
请问如何把层ndiv和mdiv关闭或者删除啊???