代码改变世界

随笔档案-2011年8月18日

iframe自适应高度

2011-08-18 15:50 by jewelry, 272 阅读, 收藏,
摘要: 1、自建ifr.js function iFrameHeight() { var ifm= document.getElementById("iframepage"); var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument; if(ifm != null && subWeb != null) { ifm.height = subWeb.body.scrollHeight; } } 2、引用ifr.js;调用如下 阅读全文