//弹出窗口高度调整自适应
function resetDialogHeight(){
if(window.dialogArguments == null){
return; //忽略非模态窗口
}
//正文高度
var height = document.body.scrollHeight;
//卷进去高度
var heightTop = document.body.scrollTop;
if (window.XMLHttpRequest) {
window.dialogHeight=(height+heightTop+5)+"px";
} else {
window.dialogHeight=(height+heightTop+55)+"px";//IE6不能自动调整高度,要加45
}
}
window.attachEvent('onload', function(){resetDialogHeight();});
js弹出窗口自适应大小
最新推荐文章于 2023-04-27 15:11:28 发布