I ve browsed through many websites and in here, and could not find a final answer as each one has its errors. I need to have an automatic IFrame height, meaning if the content changes, the Iframe must adapt its height to the content. For this I need to see how to get the correct content height?
As I understand the most correct way is to use : document.getElementById( myIframe ).style.pixelHeight = document.getElementById( myIframe ).contentWindow.document.body.scrollHeight;
然而,所有浏览器的工作都是正确的。 在IE,我发现身高太小(大约8个奶粉的高度低于应有的高度)。 在减少内容量时,停机坪总会减少。 此外,它还在Safari开展工作。
因此,就最后的问题而言,什么是最正确的,什么是证明是使内容达到顶峰的最为有效的方法——应该确定“综合框架”的高度?
Thanks, Tal.