IFRAME高度自适应

<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 + 20;
        }
    }  
</script>

<iframe id="iframepage" src=\'#\'" %>" onLoad="iFrameHeight()" scrolling="no" frameborder="0" width="100%" style="visibility:visible;"></iframe>

你可能感兴趣的:(iframe,职场,高度自适应,休闲)