Iframe自动适应高度

var ifrm = document.getElementById("Iframe_com");
        ifrm.src=url;
        ifrm.className="vis1";
        ifrm.style.height=ifrm.document.body.scrollHeight+1+"px";


又或者
function Iframe_com_onload()
        {
            document.all.Iframe_com.style.height=(Iframe_com.document.body.scrollHeight+50)+"px";
            window.scrollTo(0,0);
        }
<iframe id="Iframe_com"   frameborder="0" width="100%"
     onload="Iframe_com_onload();"></iframe>
原文地址:https://www.cnblogs.com/ahuo/p/812397.html