关于IFRAME 自适应高度的研究

NO.1
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>
<IFRAME id="test" name="test" frameBorder=0 scrolling=no src="reg.asp" width="100%" height=0></IFRAME>
</body>

</html>
<SCRIPT FOR=window EVENT=onload LANGUAGE="Jscript">

document.all("test").height=test.document.body.scrollHeight;

</SCRIPT>

NO.2
<html>
<head>
<title> New Document </title>
<script language="Javascript" for="mainid" event="onload">
maimbox.height = main.document.body.scrollHeight + 10;
</script>
</head>

<body>
aaaaaaaaaaa<br>
<table border="0" width="770" cellspacing="0">
<tr>
<td colspan="2" id="maimbox" height="500">
<IFRAME src="home.htm" name="main" id="mainid" scrolling=no frameBorder=0 width="100%" height="100%" marginwidth="1" marginheight="0"></IFRAME>
</td>
</tr>
</table>
xxxxxxxxxxxxx
</body>
</html>


上一篇: 动态设置页面字大小
下一篇: 网页图片不能正常显示
文章来自: 网络
引用通告: 查看所有引用 | 我要引用此文章
Tags:
最新日志:
评论: 1 | 引用: 0 | 查看次数: 3881
发表评论
登录后再发表评论!