I have this javascript function which is part of the subModal DHTML code you can get off the web,
The js function grabs the height and width of the parent window in order to place a popup window over the web page. The popup window mimics the showModalDialog(), which is fine in IE, but is not really modal in FF. This subModal is a new twist that makes it modal in FF, using a div and setting a mask over the parent window.
Well, my web pages are built using frames, so the parent window is like the workspace area. So, when the subModal appears (by clicking on a button on the page), it turns off access to all elements in the workspace, but not elements, like tabs that are outside of the parent window. The web page has a heirarchy to it, so I would like to grab the height and width of the entire window or windows, not just the parent window. Any ideas?
Thanks,
Todd
The js function grabs the height and width of the parent window in order to place a popup window over the web page. The popup window mimics the showModalDialog(), which is fine in IE, but is not really modal in FF. This subModal is a new twist that makes it modal in FF, using a div and setting a mask over the parent window.
Well, my web pages are built using frames, so the parent window is like the workspace area. So, when the subModal appears (by clicking on a button on the page), it turns off access to all elements in the workspace, but not elements, like tabs that are outside of the parent window. The web page has a heirarchy to it, so I would like to grab the height and width of the entire window or windows, not just the parent window. Any ideas?
Code:
/**
* Sets the size of the popup mask.
*
*/
function setMaskSize()
{
var theBody = document.getElementsByTagName("BODY")[0];
var fullHeight = getViewportHeight();
var fullWidth = getViewportWidth();
alert("fullHeight: " + fullHeight + ", fullWidth: " + fullWidth);
// Determine what's bigger, scrollHeight or fullHeight / width
if (fullHeight > theBody.scrollHeight)
{
popHeight = fullHeight;
}
else
{
popHeight = theBody.scrollHeight;
}
if (fullWidth > theBody.scrollWidth)
{
popWidth = fullWidth;
}
else
{
popWidth = theBody.scrollWidth;
}
gPopupMask.style.height = popHeight + "px";
gPopupMask.style.width = popWidth + "px";
}
Thanks,
Todd