我附上了演示問題的示例代碼。我在Firefox 3.5.7中檢查這個。問題是父HTML有一個滾動條,並且加載其全屏的iframe(高度:100%,寬度:100%),我想的IFRAME加載後要除去的父滾動條。如何在加載iframe後隱藏父垂直滾動條?
1)這是可能做到? 2)當我們給身高:100%;寬度: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的紅色背景不會完全填充整個父級。
頂我特意把這些BR的,這樣滾動條出現在父HTML。當我們說身高:100%,反正我們可以做出100%相對於父母的HTML? – Manohar 2010-02-02 09:18:49