再谈iframe自适应高度

来源:互联网 发布:java ansi编码转utf8 编辑:程序博客网 时间:2024/05/01 14:59

 ><script type="text/javascript">

function reinitIframe()

{

var iframe = document.getElementById("frame_content");

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)

{

}

}

window.setInterval("reinitIframe()", 200);</script>

原创粉丝点击