iframe自适应

//设置iframe的width与高度自适应
function setIframe()
{  
id=document.getElementById("frameBord");
id.height=0;
var y=0;
var subWeb = document.frames ? document.frames["Id"].document : id.contentDocument;
if(id != null && subWeb != null) {
           id.height = subWeb.body.scrollHeight;
           }
       }

你可能感兴趣的:(js iframe)