iframe自适应高度

来源:互联网 发布:软件行业会计处理 编辑:程序博客网 时间:2024/05/22 14:12
function iFrameHeight() { var ifm= document.getElementById("common"); //获得iframe,common为iframe的ID //document.frames['common'].document是IE6 IE7中的方法 var subWeb = document.frames ? document.frames["common"].document : ifm.contentDocument; if(ifm != null && subWeb != null) { $(ifm).height(subWeb.body.scrollHeight);} } 

1 0