The first method:
Copy Code code as follows:
<script type= "Text/javascript" language= "JavaScript" >
<!--
Adjust the height of the PageContent
function Tuneheight () {
var frm = document.getElementById ("content01");
var subweb = Document.frames? document.frames["content01"].document:frm.contentdocument;
if (frm!= null && subweb!= null) {
Frm.height = SubWeb.body.scrollHeight;
}
}
-->
</script>
<iframe id= "content01" name= "content01" frameborder=0 scrolling=no src= "main.html" width= "100%" onload= "Tuneheight" () "></iframe>
The second method:
JS Code:
Copy Code code as follows:
IFRAME adaptive height [tested through IE6 IE7]
function Resetiframe () {
var iframe = document.getElementById ("Iframeid");
try{
var bheight = iframe.contentWindow.document.body.scrollHeight;
var dheight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max (bheight, dheight);
Iframe.height = height;
}catch (ex) {}
}
Html:
Copy Code code as follows:
<iframe src= "" id= "weather" name= "weather" width= "278" onload= "Resetiframe ()" marginwidth= "0" marginheight= "0" Scrolling= "No" frameborder= "0" border= "0" framespacing= "0" > </iframe>