【发布时间】:2010-10-10 01:54:45
【问题描述】:
我似乎在使用 Google Chrome 时遇到了 iFrame 调整大小问题。
> <script language="javascript" type="text/javascript">
function resizeIframe(obj)
{
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}
</script>
<
这在我的标题中。
> <iframe id="content" name="content" frameborder="0" scrolling="no" width="950px" src="html/index2.html" onload='javascript:resizeIframe(this);'></iframe> <
这是我的 iframe 脚本。
所以我要做的是根据页面内容动态调整 iFrame 的大小,它可以在 Firefox 和 IE 中完美运行,但在 Chrome 中却不行。是什么赋予了?有什么想法吗?
提前致谢。
【问题讨论】:
标签: javascript iframe google-chrome