iframe自适应高度

<iframe src="/proInfo.do?method=sitList" id="ifr" onload="iframeFitHeight(this)"  frameborder="0" width="100%" scrolling="no" ></iframe>  
<script>  
 
    function iframeFitHeight(oIframe)   
    {//Iframe窗口自适应高度 兼容IE6.0 FF2.0以上   
    try   
    {   
        var oWin = oIframe.name ? window.frames[oIframe.name] : oIframe.contentWindow;    
        oIframe.style.height = oWin.document.body.scrollHeight + "px";   
    }   
    catch(e){}   
    }   
</script>

你可能感兴趣的:(iframe)