[SOLVED] Frame width changes with browser resizing
Is it possible to have a frame in a launch page change its length when the browser window is resized?This message has been edited. Last edited by: JohnB,
WF 7.7.03, Windows 7, HTML, Excel, PDF
April 15, 2009, 03:38 AM
GamP
I have something similar, only in my case it does not concern resizing, but just when populating the iframes. My setup is such that I always have 3 reports on the page, 2 tabular and 1 graph. The length of these vary. The following bit of javascript is in my page and gets activated immediately after the last iframe has recevied its contents.
// ----------------------------------------------------------------------------------------------------------
// All FRAMES are complete. Find out the length of the content of each frame and alter the height accordingly
// ----------------------------------------------------------------------------------------------------------
var posTopNew = 0;
function resizeFrames() {
clearTimeout(timer);
//Find out the top position of the first frame.
posTopNew = parseInt(document.getElementById('report1').style.top);
setFrameProperties('report1');
setFrameProperties('report2');
setFrameProperties('graph1');
}
function setFrameProperties(obj) {
tmpObj = document.getElementById(obj);
//Find out the height of the content of the frame
newHeight = tmpObj.contentWindow.document.body.scrollHeight;
//Set the height of the frame accordingly (+5 for margin)
tmpObj.style.height = newHeight + 5;
tmpObj.style.top = parseInt(posTopNew);
tmpTop = tmpObj.style.top;
tmpHeight = tmpObj.style.height;
//posTopNew now is the start position of the next frame
posTopNew = parseInt(tmpTop) + parseInt(tmpHeight) + 5;
}
I hope that you can use this code to at least get an idea of how you could meet your requirement.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
April 15, 2009, 04:55 PM
Waz
Instead of using top, height, left, width, you can use pixelTop, pixelHeight, pixelWidth and pixelLeft. These are already integers, and do not need to be parsed.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
April 16, 2009, 12:09 PM
Moogle
When you are in the HTML Layout Painter / Composer, select the object (IE. iframe) that you wish to have dynamically sized. In the properties panel, find width. Enter something like 95%. Do the same for height; maybe 80%. You can also use percentages for the starting position values.
Run the page and you will have a dynamically resized iframe, based on the window size and screen resolution.