给你一个实例:
<HTML>
<HEAD>
<TITLE>xxxxxxxxxxxxxx</TITLE>
<STYLE>
.navPoint {
COLOR: blue; CURSOR: hand; FONT-FAMILY: Webdings; FONT-SIZE: 9pt
}</STYLE>
<SCRIPT>
function switchBar(){
if (switchPoint.innerText==7){
switchPoint.innerText=8
document.all("frmTitle").style.display="none"
}
else{
switchPoint.innerText=7
document.all("frmTitle").style.display=""
}
}
</SCRIPT>
<BODY scroll=no style="MARGIN: 0px">
<TABLE border=0 cellPadding=0 cellSpacing=0 height="100%" width="100%">
<TBODY>
<TR>
<TD align=middle id=frmTitle noWrap vAlign=center name="frmTitle" width='6%'>
<IFRAME frameBorder=0 id=BoardTitle name=BoardMenu scrolling=yes src="bbb.php" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 148px; Z-INDEX: 2"></IFRAME>
<TD bgColor=#d2e8e6 onclick=switchBar() style="WIDTH: 10pt">
<SPAN class=navPoint id=switchPoint title=关闭/打开菜单>7</SPAN>
</TD>
<TD style="WIDTH: 100%">
<IFRAME frameBorder=0 id=frmright name=forum src="xxx.php" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1"></IFRAME>
</TD>
</TR>
</TBODY>
</TABLE>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>xxxxxxxxxxxxxx</TITLE>
<STYLE>
.navPoint {
COLOR: blue; CURSOR: hand; FONT-FAMILY: Webdings; FONT-SIZE: 9pt
}</STYLE>
<SCRIPT>
function switchBar(){
if (switchPoint.innerText==7){
switchPoint.innerText=8
document.all("frmTitle").style.display="none"
}
else{
switchPoint.innerText=7
document.all("frmTitle").style.display=""
}
}
</SCRIPT>
<BODY scroll=no style="MARGIN: 0px">
<TABLE border=0 cellPadding=0 cellSpacing=0 height="100%" width="100%">
<TBODY>
<TR>
<TD align=middle id=frmTitle noWrap vAlign=center name="frmTitle" width='6%'>
<IFRAME frameBorder=0 id=BoardTitle name=BoardMenu scrolling=yes src="bbb.php" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 148px; Z-INDEX: 2"></IFRAME>
<TD bgColor=#d2e8e6 onclick=switchBar() style="WIDTH: 10pt">
<SPAN class=navPoint id=switchPoint title=关闭/打开菜单>7</SPAN>
</TD>
<TD style="WIDTH: 100%">
<IFRAME frameBorder=0 id=frmright name=forum src="xxx.php" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1"></IFRAME>
</TD>
</TR>
</TBODY>
</TABLE>
</BODY>
</HTML>
http://expert.csdn.net/Expert/topic/868/868840.xml?temp=.4932825
<iframe id=aa src=b.htm></iframe>我希望在test.htm中添加代码控制iframe的高度,而不是在b.htm中用parent!
<script language="javascript">function resize()
{ parent.window.document.all.mainiframe.height=document.body.scrollHeight + 30;
}
</script>
<body onload="resize()"
test中控制不清楚。