用于解决iframe自适应高度
Posted in 默认分类 on 六月 18th, 2009 by admin – Be the first to comment
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()", 1000);
在新浪站上看到的不错,收藏下.
目前我们自己常用的
调用页面.
被调用页面
window.onload = function(){
var height = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
parent.call_frame(height)
}