自适应内嵌页面高度 不指定

Else , 2009/03/30 19:29 , 代码片段,演示也有 , 评论(0) , 阅读(717) , Via 本站原创 | |

<script>
//自适应内嵌页面高度
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>
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]