iframe sizing - cross browser issue

折月煮酒 提交于 2019-12-06 04:43:39
rams

We had a similar issue with iframe sizing on our web app main page, although in IE6. The solution was to trap the window.onresize event and call a JavaScript function to appropriately size the iframe. content is the name of the iframe we want sized. Also note that we are using ASP.Net AJAX's $get which translates to document.getElementById()

window.onresize=resizeContentFrame;
resizeContentFrame();

function resizeContentFrame() {
    setFrameHeight($get('content'));
}

function setFrameHeight(f) {
    if(isDefined(f)) {
        var h=document.documentElement.scrollHeight;
        h-=(HEADER_HEIGHT+CONTENT_PADDING+5);
        f.style.height=h+'px';
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!