中国WEB大本营
致力于Web标准在中国的发展
(冬季版)
Menu:
HomePage
Div+Css 教程
CSS布局实例
CSS2.0教程
DotNet频道
ASP.NET Blog资源
Web标准
XHTML教程
�������������ִ�
�ύ�������
CSS布局实例
Iframe高度自适应 IE与FF环境下均可用
Author:oeedu.com Data:2008-4-9
字体大小:
小
中
大
[RSS]订阅
|
上一篇
|
下一篇
Iframe高度自适应 IE与FF环境下均可用
看下面的代码:
Example Source Code
[www.oeedu.com]
<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="http://www.oeedu.com/"></iframe>
查看运行效果:
Source Code to Run
[www.oeedu.com]
Iframe高度自适应 IE与FF环境下均可用
www.oeedu.com
[ 可先修改部分代码 再运行查看效果 ]
Article Provenance:
Internet
Article Tags:
Iframe
Iframe
高度自适应
高度自适应
ie
ie
FF
FF
评论: 0 | 查看次数: 1283