<script type="text/javascript">
function SetCwinHeight(){
var bobo=document.getElementById("bobo"); //iframe id
if (document.getElementById){
if (bobo && !window.opera){
if (bobo.contentDocument && bobo.contentDocument.body.offsetHeight){
bobo.height = bobo.contentDocument.body.offsetHeight;
}else if(bobo.Document && bobo.Document.body.scrollHeight){
bobo.height = bobo.Document.body.scrollHeight;
}
}
}
}
</script>
<iframe width="100%" id="bobo" onload="Javascript:SetCwinHeight()"
height="1" frameborder="0"
src="/default.asp?cateID=1"></iframe>
HTML代码:
<!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=utf-8" />
<title>iframe</title>
</head>
<body>
<script type="text/javascript">
function SetCwinHeight(){
var bobo=document.getElementById("bobo"); //iframe id
if (document.getElementById){
if (bobo && !window.opera){
if (bobo.contentDocument && bobo.contentDocument.body.offsetHeight){
bobo.height = bobo.contentDocument.body.offsetHeight;
}else if(bobo.Document && bobo.Document.body.scrollHeight){
bobo.height = bobo.Document.body.scrollHeight;
}
}
}
}
</script>
<iframe width="100%" id="bobo" onload="Javascript:SetCwinHeight()"
height="1" frameborder="0"
src="/default.asp?cateID=1"></iframe>
这里写几个字试试!子鼠!
</body>
</html>
分享到:
相关推荐
iframe 自适应高度iframe 自适应高度iframe 自适应高度iframe 自适应高度iframe 自适应高度iframe 自适应高度iframe 自适应高度iframe 自适应高度
因为有一个项目要用到iframe自适应高度,网上搜索了以下结果无数,不过看来看去都是那...iframe自适应高度,亲测完美兼容IE6_7_8_9,Chrome谷歌浏览器,Opera欧朋浏览器,FireFox火狐浏览器,Mac Safari浏览器等五大浏览器
iframe自适应高度和宽度
iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe自适应高度说明文档iframe...
这个库允许的高度与同跨域iframe来适应他们所包含的内容的宽度自动调整大小。它最常见的问题与使用iframes提供一系列的功能,其中包括: 高度和宽度大小的iframe内容大小。 作品以多个嵌套的iframe。 跨域iframe域...
纯JS实现的iframe自适应高度。兼容主流浏览器。
iframe自适应高度(兼容多种浏览器) 亲测可以
Iframe自动根据类容改变自己的大小,解决Iframe设置高度后无法缩小!拜一个高人所赐,特表示感谢!
jquery对iframe自适应高度插件是国外下载下来的。插件使用只要引用js文件就行,不用做任何别的操作完全自动化。
iframe 跨域 自适应高度 模板 iframe 跨域 自适应高度 模板 iframe 跨域 自适应高度 模板
iframe自适应高度 .txtiframe自适应高度 .txtiframe自适应高度 .txtiframe自适应高度 .txtiframe自适应高度 .txt
多层嵌套iframe 自适应高度的解决方法
iframe自适应高度
javascript iframe 自适应高度js demo
iframe自适应高度 .doc
介绍: 填写的嵌入地址一定要和本页面在同一个站点上,否则会提示“拒绝访问!”。对跨域引用有权限问题,请查阅其他资料。
iframe自适应高度的简单解决办法,word文档中有详细的解释,赶快下载吧!
iframe自适应高度(DOM动态操作)
iframe自适应高度:根据屏幕的高度,自动增减。包括适应浏览器高度的改变。
iframe根据引用的页面内容自适应高度和宽度,直接查看例子,简单易操作