Have a look at my JavaScript code...
I am calling this function when a page is loaded. The page attached to a frame of a parent window. First alert shows the parent window offsetHeight, the actual one acquired by the parent window. And the second alert shows the actual height of the current window. If i don't add 40 with document.body.o ffsetHeight it would show me the scroll bars in the window, but i write this code to fit the current window according to the resolution. Where i am going wrong ?
Code:
function resizeFrameToFitScreen(){
var outerFrameSet = window.parent.document.getElementById('outerFrameSet');
alert(parent.document.body.offsetHeight);
alert(document.body.offsetHeight);
var top_frame_percentage = Math.round((100/parent.document.body.offsetHeight)*(document.body.offsetHeight+40));
outerFrameSet.rows = top_frame_percentage+'%,'+(100-(top_frame_percentage+30))+'%,30%';
window.parent._top_frame_percentage = top_frame_percentage;
}
Comment