iframe 自适应高度


<script type="text/javascript">
function reinitIframe(){
var iframe = document.getElementById("info");
try{

var bHeight = iframe.contentWindow.document.body.scrollHeight;

var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;

var height = Math.max(bHeight, dHeight-10);

iframe.height = height;

}catch (ex){}

}
window.setInterval("reinitIframe()", 10);
</script>
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页