框架自动适应高度《一》

JS代码

function ifmHtAuto(obj){ 
    var ifm= document.getElementById(obj);   
    var subWeb = document.frames ? document.frames[obj].document : ifm.contentDocument;   
    if(ifm != null && subWeb != null) {
       ifm.height=subWeb.body.offsetHeight;
      // ifm.height = subWeb.body.scrollHeight;

    }  
  }

 

posted @ 2013-04-12 14:54  关小庆  阅读(160)  评论(0编辑  收藏  举报