iframe高度自适应

来源:互联网 发布:什么阅读软件书最全 编辑:程序博客网 时间:2024/06/07 07:15
    function iFrameHeight(){        var iframe = document.getElementById("iframeContain");        iframe.height = 0;        try{            var bHeight = iframe.contentWindow.document.body.scrollHeight;            var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;            var height  = Math.max(bHeight, dHeight);            iframe.height =  height;        }catch (ex){}            }

原创粉丝点击