Home  >  Article  >  Web Front-end  >  Iframe adaptive highly compatible with ie, firefox multi-browser_Experience exchange

Iframe adaptive highly compatible with ie, firefox multi-browser_Experience exchange

WBOY
WBOYOriginal
2016-05-16 12:06:091899browse
Copy Code The code is as follows:

<script> <BR> function SetCwinHeight(){ <BR>  var bobo=document.getElementById("bobo"); //iframe id <BR>  if (document.getElementById){ <BR>   if (bobo && !window.opera){ <BR>    if (bobo.contentDocument && bobo.contentDocument.body.offsetHeight){ <BR>     bobo.height = bobo.contentDocument.body.offsetHeight; <BR>    }else if(bobo.Document && bobo.Document.body.scrollHeight){ <BR>     bobo.height = bobo.Document.body.scrollHeight; <BR>    } <BR>   } <BR>  } <BR> } <BR></script>



[Ctrl A Select all Note:If you need to introduce external Js, you need to refresh it to execute]
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn