首页  >  文章  >  php教程  >  iframe 框架自动适应高度

iframe 框架自动适应高度

WBOY
WBOY原创
2016-06-06 20:00:481191浏览

function reinitIframe(){ var iframe = document.getElementById(frame_content);尝试{ var bHeight = iframe.contentWindow.document.body.scrollHeight; var dHeight = iframe.contentWindow.document.documentElement.scrollHeight; var height = Math.m

函数reinitIframe(){
var iframe = document.getElementById("frame_content");
尝试{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height = 高度;
}
抓住(前){}
}
window.setInterval("reinitIframe()", 200);

 

 

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn