如何从容器页面中显示的页面增加容器页面的iframe的高度

How to increase the height of iframe of container page from the page shown inside it

本文关键字:增加 高度 iframe 显示      更新时间:2023-09-26

我有一个应用程序,它将显示在iframe中。

<iframe src="http://localhost/xxxxx.aspx"></iframe>

此容器的高度和宽度为900px and 600px。我希望我的应用程序处于全屏状态,那么现在有可能改变容器iframe的高度和宽度吗??P.S iframe不在同一个项目中,所以

$("iframe").css("height","1000px")

无法作为其他文件工作。

指定应用选择器的上下文:

 $("iframe", window.parent.document).css("height","1000px");

以下是一个具有不同文件的示例:http://www.css-arts.com/iframe_test/iframe_test.html

当iframe内容页是父页之外的另一个域时,浏览器通常会阻止对iframe父页的访问。如果是这样的话,你就没有机会了。

这样的东西怎么样:

<iframe src="http://adobe.com" style="border:0px #FFFFFF none;" name="myiFrame" scrolling="no" frameborder="1" marginheight="0px" marginwidth="0px" height="600px" width="900px"></iframe>