iframe自适应高度

<iframe src="http://www.fufuok.com/" id="iframepage" name="iframepage" frameBorder=0 scrolling=no width="100%" onLoad="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>
原文地址:https://www.cnblogs.com/shcolo/p/4152636.html