现在有这样的代码:
<table width="100%" border="1">
<tr>
<td><iframe height="100%" width="100%" src="home:blank"></iframe></td>
</tr>
</table>或者:<div><iframe height="100%" width="100%" src="home:blank"></iframe></div>可以让iframe的高度随td 或 div 的高度而变吗?
<table width="100%" border="1">
<tr>
<td><iframe height="100%" width="100%" src="home:blank"></iframe></td>
</tr>
</table>或者:<div><iframe height="100%" width="100%" src="home:blank"></iframe></div>可以让iframe的高度随td 或 div 的高度而变吗?
function iFrameHeight()
{
var ifm= document.getElementById("iframepage");
var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;
if(ifm != null && subWeb != null)
{
ifm.height = subWeb.body.scrollHeight;
}
} <iframe width="100%" frameborder="0" id="iframepage" scrolling="no" name="iframepage"
onload="iFrameHeight()" src="defaultUrl.aspx"></iframe>