在嵌入页面不能全部展示的问题中,可以通过js改变iframe的高度

html部分代码:

<iframe src="#" name="i" ></iframe>

js部分代码:

function reinitIframe() {
var iframe = document.getElementById("urlIframe");
try
{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
iframe.height = bHeight;
} catch (ex) { }
}

 

相关文章: