function getDocHeight()
{
var D = document;
return Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight));
}
function setIframeHeight(frameId, offset)
{
document.getElementById(frameId).height = (getDocHeight()-offset)+'px';
}
var resizeIframeTimeOut = null;
var func = function() {setIframeHeight('boInfoViewIframe', 150);};
window.onresize = function(){
if(resizeIframeTimeOut != null) clearTimeout(resizeIframeTimeOut);
setTimeout(func, 100);
};
setIframeHeight('boInfoViewIframe', 150);
One note about resizing elements is that IE will resize again if your new size causes the document size to grow. That was a two hour lesson for me :)
No comments:
Post a Comment