首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

弹出框IE6停高度不能100%

2013-08-10 
弹出框IE6下高度不能100%function M_notice(show_div,bg_div){document.getElementById(show_div).style.d

弹出框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());
};

热点排行
Bad Request.