ddc
联网
Dreamweaver Flash Photoshop 其它周边 web标准 asp php .net CSS WAP网站攻略 专题
网站建设 域名注册 网站建设 虚拟主机 广州网站设计 域名注册 广州网站建设 上海网站建设 虚拟主机 广州网页设计 虚拟主机 域名注册 acg王国 ACG玩家 品牌设计 上海网站建设
求创科技
网站建设
中国互联
素材出售
中国设计秀
中资源
当前位置:网络学院首页 >> 设计教程 >> web标准 >> web标准中Iframe自适应高度[ie_firefox下都可用]

web标准中Iframe自适应高度[ie_firefox下都可用]

来源:中国设计秀    作者:    点击:535     加入收藏
关键字:标准 适应
从网上找的,不是自已写的! 从哪找的忘了,要不一定写明出处! 放出来给自已留个备份!

程序代码
<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>
代码如下:


        
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
0
顶一下
2008-05-25 10:46:51    出处:互联网
Google
热点文章/相关文章
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明 | 网站公告 | 友情链接 | 留言 | 旧版入口