iframe自适应高度

function SetWinHeight(obj){
   var win=obj;
   if (document.getElementById){
    if (win && !window.opera){
     if (win.contentDocument && win.contentDocument.body.offsetHeight)
      win.height = win.contentDocument.body.offsetHeight;
     else if(win.Document && win.Document.body.scrollHeight)
      win.height = win.Document.body.scrollHeight;
    }
   }
  }
<iframe src=\'#\'" onload="Javascript:SetWinHeight(this)"></iframe>

你可能感兴趣的:(iframe,职场,休闲,自适应高度)