Toc
0 results found
Seven Chen
Iframe自适应高度和宽度
2008/02/18 NULL php

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;
      win.width =win.contentDocument.body.offsetWidth;
      }
     else if(win.Document && win.Document.body.scrollHeight)
     {
      win.height = win.Document.body.scrollHeight;
      win.width=win.Document.body.scrollWidth;
      }
    }
}
}

然后在里面写入如下

humen1 Tech

本文作者:Seven Chen
版权声明:本文首发于Seven Chen的博客,转载请注明出处!