首页 > 代码库 > iframe自适应高度

iframe自适应高度

<iframe src="http://www.fufuok.com/" id="iframepage" name="iframepage" frameBorder=0 scrolling=no width="100%" onl oad="iFrameHeight()" ></iframe>

Javascript代码: <script type="text/javascript" language="javascript">   function iFrameHeight() {     var ifm= document.getElementById("iframepage");     var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;     if(ifm != null && subWeb != null) {       ifm.height = subWeb.body.scrollHeight;     }   } </script>

 

iframe自适应高度