<!--动态调整所在iframe的大小-->
<script type="text/javascript" language="javascript">
function resizeIframe()
{
var targWin=self.parent.document.getElementById("myframe");
if(targWin!=null)
{
var heightValue=self.document.body.scrollHeight;
targWin.height=heightValue + 20; //多加20以显示最后一行
}
}
window.onload=resizeIframe;
</script>
主页面iframe:<script type="text/javascript" language="javascript">
function resizeIframe()
{
var targWin=self.parent.document.getElementById("myframe");
if(targWin!=null)
{
var heightValue=self.document.body.scrollHeight;
targWin.height=heightValue + 20; //多加20以显示最后一行
}
}
window.onload=resizeIframe;
</script>
<iframe id="myframe" style="overflow:visible; 100%; display:block" scrolling="no" frameborder="0" src="test.aspx"></iframe>