日期:2014-05-16  浏览次数:20331 次

弹出框IE6下高度不能100%

function M_notice(show_div,bg_div){
document.getElementById(show_div).style.display='block';
document.getElementById(bg_div).style.display='block' ;
var bgdiv = document.getElementById(bg_div);
bgdiv.style.width = document.body.scrollWidth;
$("#"+bg_div).height($(document).height());

};
//关闭弹出层
function CloseDiv(show_div,bg_div){
document.getElementById(show_div).style.display='none';
document.getElementById(bg_div).style.display='none';
};

<div onclick="M_notice('add_notice','fade')">开</div>
<div id="fade" class="black_overlay"></div>
<div id="add_notice" class="white_content"></div>
从display:none 变成display:block  
现在是正常的.
我想从display:block 变成display:none 
飙红的代码怎么用上...

------解决方案--------------------
function M_notice(show_div,bg_div){
    document.getElementById(show_div).style.display='block';
    document.getElementById(bg_div).style.display='block' ;
    ///////////
    var bgdiv = document.getElementById(bg_div);
    bgdiv.style.width = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth) + 'px';
    bgdiv.style.height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) + 'px';
   // $("#"+bg_div).height($(document).height());
};