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;
}
}
求帮忙解决!!
回复讨论(解决方案)
跨域了,放到服务器上就不会
那如何判断是否是跨域了呢
域不一样,协议不一样,本地文件浏览(有些浏览器不会跨域)
代码放到服务器上之后,并没有实现理想的效果,而是iframe高度一下子都变成了2000……
查看更多关于iframe自适应高度_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did106116