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>
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>
相关文章推荐
- 使用事件捕获实时捕获img是否加载完毕, 实现iframe内容高度自动适应
- JavaScript应用:Iframe自适应其加载的内容高度
- JavaScript应用:Iframe自适应其加载的内容高度
- JavaScript应用:Iframe自适应其加载的内容高度
- Iframe自适应其加载的内容高度
- Iframe自适应其加载的内容高度
- Iframe自适应其加载的内容高度
- JavaScript应用:Iframe自适应其加载的内容高度
- 让iframe自动适应内容高度
- javascript应用:Iframe自适应其加载的内容高度
- Iframe自适应其加载的内容高度
- Iframe自适应其加载的内容高度
- 如何让iframe自动适应内容高度
- Iframe自适应其加载的内容高度
- iframe自动适应加载页面高度
- Iframe自适应其加载的内容高度
- JavaScript应用:Iframe自适应其加载的内容高度
- JS怎么控制IFRAME高度自动适应内容而不出现滚动条
- JavaScript应用:Iframe自适应其加载的内容高度
- JavaScript应用:Iframe自适应其加载的内容高度