I had to use IFRAME, So I struggled with IFRAME for a day. (Test browsers: IE6, IE7, IE8, and ff3.0)
Program code:
<Div class = "side_left">
<IFRAME src = http://www.webyi.com/wschool/wdesign/HTML/20091016/ "left.html" name = "leftframe" id = "leftframe" scrolling = "no" width = "170px" Height = "330px" frameborder = "0"> </iframe>
</Div>
<Div class = "content">
<IFRAME src = http://www.webyi.com/wschool/wdesign/html/20091016/ "right1.html" name = "mainframe" id = "mainframe" width = "740px" frameborder = "0" scrolling = "no"> </iframe>
</Div>
Typically, you can click the frame on the right of the menu on the left to display it. First, the target is clearly specified for the link, but it is opened in a new window under Firefox. It took a long time to troubleshoot and found that a very low-level error was useless </iframe>. Directly <IFRAME.../>. No problem in IE. FF quit ....
Then, the right frame automatically adapts to the height with the content. There are a lot of solutions on the Internet that seem to be usable. Solution: Execute Js in the onload event of IFRAME on the homepage to get the height of the contained page, and then synchronize the height.
Program code:
<IFRAME src = http://www.webyi.com/wschool/wdesign/HTML/20091016/ "right1.html" name = "mainframe" id = "mainframe" width = "740px" frameborder = "0" scrolling = "no"> </iframe>
<SCRIPT type = "text/JavaScript">
Function reinitiframe (){
VaR IFRAME = Document. getelementbyid ("mainframe ");
Try {
VaR bheight = iframe.content20.doc ument. Body. scrollheight;
VaR dheight = iframe.content?document.doc umentelement. scrollheight;
VaR Height = math. Max (bheight, dheight );
IFRAME. Height = height;
} Catch (Ex ){}
}
Window. setinterval ("reinitiframe ()", 200 );
</SCRIPT>
From: http://www.norkoo.com/show/Tech/Tech_HTML/adiekhjjakijhhdkiecbdkigfjkhdeb.aspx