iframe自适应高度

//iframe自适应高度
function SetCwinHeight(iframeID){
var bobo=document.getElementById(iframeID);
if (document.getElementById){
if (bobo && !window.opera){
if (bobo.contentDocument && bobo.contentDocument.body.offsetHeight){
bobo.height = bobo.contentDocument.body.offsetHeight+20+'px';
}else if(bobo.Document && bobo.Document.body.scrollHeight){
bobo.height = bobo.Document.body.scrollHeight+20+'px';
}
}
}
}
posted @ 2008-11-12 16:35  农十四  阅读(174)  评论(0编辑  收藏  举报