<div class="main">
<iframe name="homepage"
id="iframepage" frameborder="0" scrolling="auto" marginheight="0"
marginwidth="0" onLoad="iFrameHeight()" width=100% height="100%">
</iframe>
这是我div中的iframe,
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;
ifm.width = subWeb.body.scrollWidth;
}
} 这是我定义的function
.main{width:100%;height:100%;background:#f6f6f6;overflow:auto;}
这是div class="main"的CSS部分 但是实际效果 我要显示的页面并没有完全显示在iframe中,网上找了很多方法对我这种情况都没有效果 求教如何解决
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你要实现什么效果,我看你的内容是在iframe的矩形框里