我正在尝试在iframe中打开Oracle Apex应用程序。我有一个index.jsp,其中包含以下代码
<body>
<iframe id="apexiFrame"
width="100% !important" height="100% !important"
src="http://localhost:9999/ords/f?p=101">
</iframe>
</body>
如果我将localhost更改为系统名称,则登录页面加载正常,但是登录后以及其他所有后续页面中进入下一页时,我可以看到添加了额外的样式属性,因此apex应用程序仅占一半iframe
我找不到从何处添加此样式属性。请帮忙。
更新:
我添加了jquery以删除页面加载时多余的样式属性。
$('iframe').load( function() {
$("iframe").removeAttr("style");
});
尽管可以做到,但在iframe加载(带有样式标签)和删除iframe之间仍然存在1秒的延迟,因此iframe的宽度从500px变为100%明显。如果有一种方法可以避免样式标签自动添加,那么我猜这将是理想的解决方案。有线索吗?
答案 0 :(得分:1)
您正在IFRAME
HTML标记内混合CSS。 width=
和height=
应该是像素width=500
或百分比height=100%
。这可能是导致问题的原因。
您可以尝试
<iframe id="apexiFrame"
style="height:100%;width:100%;"
src="http://localhost:9999/ords/f?p=101">
</iframe>
不确定!important在样式标签上的位置。
现在,要查看是否可以摆脱APEX的样式,请在APEX Designer的“应用程序构建器”选项卡中打开应用程序,选择“共享组件”,然后在用户界面块中,在“主题和模板”链接周围徘徊。
答案 1 :(得分:0)
我添加了jquery以删除iframe加载时多余的样式属性,然后重新启动服务器。
$('iframe')。load(function(){
$(“ iframe”)。removeAttr(“ style”);
});