法一:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>iframe 自适应高度[ff,ie下大同小异]</title>
<script language="javascript" type="text/javascript">
function dyniframesize(down) {
var pTar = null;
if (document.getElementById) {
pTar = document.getElementById(down);
} else {
eval('pTar = ' + down + ';');
}
if (pTar && !window.opera) {
//begin resizing iframe
pTar.style.display = "block"
if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight) {
//ns6 syntax
pTar.height = pTar.contentDocument.body.offsetHeight + 20;
pTar.width = pTar.contentDocument.body.scrollWidth + 20;
} else if (pTar.Document && pTar.Document.body.scrollHeight) {
//ie5+ syntax
pTar.height = pTar.Document.body.scrollHeight;
pTar.width = pTar.Document.body.scrollWidth;
}
}
}
</script>
</head>
<body>
<!-- 头部iframe -->
<div style="width: 100%; border: 0px solid #3C72B0; background-image: url(../images/head_bg.png); background-repeat: repeat-x;">
<iframe src="top.html" width="100%"></iframe>
</div>
<!-- 中间左右侧iframe -->
<div style="border: #000000 0px solid; float: left; width: 100%;">
<div style="float: left; width: 20%;">
<iframe src="left.html" scrolling="no" height="100%" id="ifm0"
name="ifm0" onload="javascript:dyniframesize('ifm0');" width="100%"></iframe>
</div>
<div style="float: left; width: 80%;">
<iframe src="right.html" scrolling="no" id="ifm"
name="ifm" onload="javascript:dyniframesize('ifm');" width="100%"></iframe>
</div>
</div>
<!-- 尾部iframe -->
<div style="height: 120px; width: 100%; background-color: #FF0000; float: left">
<iframe src="bottom.html" width="100%"></iframe>
</div>
</body>
</html>
分享到:
相关推荐
iframe 自适应高度iframe 自适应高度iframe 自适应高度iframe 自适应高度iframe 自适应高度iframe 自适应高度iframe 自适应高度iframe 自适应高度
iframe自适应高度和宽度
iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe...
这个库允许的高度与同跨域iframe来适应他们所包含的内容的宽度自动调整大小。它最常见的问题与使用iframes提供一系列的功能,其中包括: 高度和宽度大小的iframe内容大小。 作品以多个嵌套的iframe。 跨域iframe域...
iframe自适应高度(兼容多种浏览器) 亲测可以
纯JS实现的iframe自适应高度。兼容主流浏览器。
Iframe自动根据类容改变自己的大小,解决Iframe设置高度后无法缩小!拜一个高人所赐,特表示感谢!
因为有一个项目要用到iframe自适应高度,网上搜索了以下结果无数,不过看来看去都是那几个,而且基本都测试了一遍,所说的兼容根本不是那么回事,要不IE不正常,要不其他浏览器显示不正常,最后无奈,综合网上的方法...
jquery对iframe自适应高度插件是国外下载下来的。插件使用只要引用js文件就行,不用做任何别的操作完全自动化。
iframe自适应高度 .txtiframe自适应高度 .txtiframe自适应高度 .txtiframe自适应高度 .txtiframe自适应高度 .txt
iframe 跨域 自适应高度 模板 iframe 跨域 自适应高度 模板 iframe 跨域 自适应高度 模板
多层嵌套iframe 自适应高度的解决方法
javascript iframe 自适应高度js demo
iframe自适应高度
iframe自适应高度 .doc
介绍: 填写的嵌入地址一定要和本页面在同一个站点上,否则会提示“拒绝访问!”。对跨域引用有权限问题,请查阅其他资料。
iframe自适应高度的简单解决办法,word文档中有详细的解释,赶快下载吧!
iframe自适应高度(DOM动态操作)
iframe自适应高度:根据屏幕的高度,自动增减。包括适应浏览器高度的改变。
iframe根据引用的页面内容自适应高度和宽度,直接查看例子,简单易操作