<div id="Wealth">
<iframe id="main" name="main" scrolling="no" src="HTMLPage3.htm" frameborder="0" width="100%"></iframe>
<script type="text/javascript">
function reinitIframe(){
var iframe = document.getElementById("main");
//alert(iframe.innerHTML);
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height = height;
}catch (ex){}
}
window.setInterval("reinitIframe()", 200);
</script>
</div>
<a href ="LinkTest.htm" target="main">LinkTest</a>
本文介绍了一种使iframe元素的高度能够自适应其内容高度的方法,并提供了一个指向新页面的链接示例,该链接会在iframe中加载指定的HTML页面。
591

被折叠的 条评论
为什么被折叠?



