在iframe中使用的页面大小. [英] page size with in the the iframe.

查看:268
本文介绍了在iframe中使用的页面大小.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我将我的网页保留在iframe中.和iframe页面src可能会更改
根据条件.

页面大小应该是什么
(与iframe一起使用,因此滚动操作也不会出现,
我不想将任何CSS应用于iframe而不显示
在iframe上滚动)?

我只想知道应该保持什么页面大小以避免在iframe中滚动?

我将页面分为2个div部分,其中一个宽度为75%,另一个宽度为25%.
当我将网页托管在iframe中时,滚动会出现在ifrmae上.我要避免
滚动并在iframe中设置任何CSS.

Hi All,

i am keeping the my page with in the iframe. and iframe page src may be change
according to condition.

what should be the page size
(keeping with in the iframe, so scroll will naver come,
i don''t want to apply any css to iframe for not showing the
scroll on iframe)?

i just want to know what page size should i keep to avoid scrolling in iframe?

i am diving my page into 2 div part one has 75% width and other has 25% with.
when i host my page in iframe then scroll appear upon the ifrmae. i wnat to avoid
scroll with out setting any css in iframe.

is there a way to do this?

推荐答案

创建一个新的.htm文档,并粘贴以下HTML代码.在IFrame的SRC属性中,您必须提供与IFrame加载的域相同的HTML页面.

Create a new .htm document, and paste the following HTML code. In the SRC attribute for the IFrame, you must supply an HTML page from the same domain that the IFrame loads.

<HTML>
<HEAD>
<SCRIPT LANGUAGE=javascript>
function reSize()
{
    try{
    var oBody   =   ifrm.document.body;
    var oFrame  =   document.all("ifrm");

    oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
    oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth - oBody.clientWidth);
    }
    //An error is raised if the IFrame domain != its container's domain
    catch(e)
    {
    window.status = 'Error: ' + e.number + '; ' + e.description;
    }
}
</SCRIPT>
</HEAD>
<BODY onload=reSize()>
    <iframe onresize=reSize() id=ifrm src=YOUR_PAGE_HERE></iframe>
</BODY>
</HTML>


这篇关于在iframe中使用的页面大小.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆