iframe,已实现自适应高度,浏览器若没有全屏,则高度变小,内容只显示部分,无滚动条,怎么解决?

来源:百度知道 编辑:UC知道 时间:2024/06/23 20:36:22
<div style="width:800px; float:left; ">
<!--右侧执行区域框架-->
<iframe id="iframe3" width="800" height="100%" scrolling="no" frameborder="0" src="basic_infor.aspx"

onload="this.style.height=parseInt(window.frames[3].document.body.scrollHeight);"></iframe>
</div>

该代码为框架部分,实现自适应。

若IE浏览器小窗口,则内容只显示窗口大小的部分,其他的不显示,不管是浏览器还是内部框架都没有滚动条,请高手指教一下
我指的是高度,宽度不用考虑。

你没明白我的意思,浏览器窗口弹出来的时候,如果不是全屏的话,那么我的网页宽度没改变,因为固定的,高度因为是自适应的,取的又是浏览器窗口的高度,所以导致浏览器窗口变矮,网页的内容也只能显示一部分,没显示出来的部分是完全看不到的,也没有滚动条之类的东西,要想全都显示,只能刷新页面。

<div style="width:800px;height:100%; float:left; ">
<!--右侧执行区域框架-->
<iframe id="iframe3" height="100%" scrolling="no" frameborder="0" src="basic_infor.aspx"

onload="this.style.height=parseInt(window.frames[3].document.body.scrollHeight);"></iframe>
</div>

看看这样行不行

另外 如果要浏览器滚动条不显示 在body里加个
<body scroll=no>

下面是谁复制我答案的????晕死了

<div style="width:800px;height:100%; float:left; ">
<!--右侧执行区域框架-->
<iframe id="iframe3" height="100%" scrolling="no" frameborder="0" src="basic_infor.aspx"

onload="this.style.height=parseInt(window.frames[3].document.body.scrollHeight);"></iframe>
</div>

如果你是想研究代码的我无话可说!就当我没说好了,但如果是想轻易解决问题的那我就说一下,右键点击任务栏--纵向平铺窗口.你打开IE--工具--Internet选项--高级--重置--确定.这样就回到