木子屋 Dnawo's BLOG

关于IFRAME 自适应高度的研究

👤 dnawo 📅 2006-09-15 👁 4481 👍 0 💬 0 🔄 网络
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>

评论(0)

暂无评论。

计算题
评论需审核通过后显示
← 上一篇 动态设置页面字大小 下一篇 → 网页图片不能正常显示