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); } }
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/14483.html