`
cocofuyi
  • 浏览: 5967 次
  • 性别: Icon_minigender_1
  • 来自: 济南
最近访客 更多访客>>
社区版块
存档分类
最新评论

iframe 自适应高度

js 
阅读更多
<iframe src="<%=retUrl %>"    id="addstaticFileIframe"   onload="doucumentTsingdao.iFrameHeight()"   name="addstaticFileIframe" frameBorder=0 scrolling=auto width="100%">
            </iframe>
//iframe自适应高度
    iFrameHeight:function(){
     try{
      var ifm=document.getElementById("addstaticFileIframe");
      var subWeb=document.frames?document.frames["addstaticFileIframe"].document:ifm.contenrDocument;
      if(ifm!=null && subWeb!=null){
       ifm.height=subWeb.body.scrollHeight+20;
      }
     }catch(error){
      //doucumentTsingdao.iFrameHeight();
       alert("请联系管理员:"+error.message);
       //window.close();
     }
    },
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics