您的位置:首页 > 其它

Iframe自动适应加载内容高度

2007-08-14 16:15 411 查看
最近在做项目的时候,我发现Iframe可以自动适应加载内容高度,觉得挺新奇,想研究一下这段JS。原来是用到meizz(梅花雪)写的JS,真佩服meizz,可以说写JS已经出神入化了。真想认识一下meizz,看能不能通过朋友介绍认识一下,那真是万分荣幸了。好了,该show一下了。

main.htm:

<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312' />
<meta name='author' content='F.R.Huang(meizz梅花雪)//www.meizz.com' />
<title>iframe自适应加载的页面高度</title>
</head>

<body>
<iframe src="child.htm"></iframe>
</body>
</html>

child.htm:

<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312' />
<meta name='author' content='F.R.Huang(meizz梅花雪)//www.meizz.com' />
<title>iframe 自适应其加载的网页(多浏览器兼容)</title>
<script type="text/javascript">
<!--
function iframeAutoFit()
if(document.attachEvent)
else
//-->
</script>
</head>
<body>
<table border="1" width="200" style="height: 400px; background-color: yellow">
<tr>
<td>iframe 自适应其加载的网页(多浏览器兼容,支持XHTML)</td>
</tr>
</table>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: