【发布时间】:2011-01-12 01:36:54
【问题描述】:
我附上了演示问题的示例代码。我在 Firefox 3.5.7 中检查这个。问题是父 HTML 有一个滚动条,它加载了一个全屏 iframe(高度:100%,宽度:100%),我希望在加载 iframe 后删除父滚动条。
1) 这可能吗? 2)当我们给出高度时:100%; width: 100% 为什么只占视图区域?但不是 整个父占用区域?
This is Main.html
<Html>
<head>
<script type="text/javascript" src="client.js"></script>
<title>
I am a client
</title>
</head>
<body bgcolor="#000000">
You can see the iframe below...
You can see the iframe below...
You can see the iframe below...<br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br><br>
<br><br><br><br><br><br>
You can see the iframe below...
<br>
<iframe name="clientframe" id = "clientframe" src = "app.html" style="position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:999;background:#ff0000"
onload = "sendparams();" frameborder="no">
</iframe>
</body>
</html>
This is app.html:
<HTML>
<HEAD>
<title>
I am an Application
</title>
</HEAD>
<BODY>
<h3>This is an application</h3>
<br>
You name <input type="textbox"> <br>
Password <input type="password"><br>
<br>
<br>
<input type="button" value ="Let me in">
</BODY>
</HTML>
注意:打开 Main.html,它将在 iframe 中加载 app.html。您会注意到加载 iframe 后会出现一个滚动条,并且 iframe 的红色背景并未完全填满整个父级。
【问题讨论】:
标签: javascript css html