Click to See Complete Forum and Search --> : Window Sizing


rwinch
09-24-2003, 11:18 PM
The following code opens 2 PopUp windows; Problem is on the "topwindowheight", I can't seem to get the window to come up with less height regardless of the size specified in the script. Any Ideas??

<script language="JavaScript">
<!--

function openWindow() {

if (window.screen) {
windowwidth = (window.screen.availWidth);
topwindowheight = (5); // Even if I put 1 window opens at same size
bottomwindowheight = (window.screen.availHeight);


}
window.open('about:blank','windowNameBottom','width='+windowwidth+',height='+bottomwindowheight+',sc reenX=0,screenY=0,top=0,left=0,resizable=yes,menubar=yes,location=yes,toolbar=yes,scrollbars=yes,sta tus=yes');

window.open('about:blank','windowNameTop','width='+windowwidth+',height='+topwindowheight+',screenX= 0,screenY=0,top=0,left=0,resizable=no,menubar=no,location=no,toolbar=no,scrollbars=no,status=no');
}

//--></script>

etard
09-24-2003, 11:59 PM
try this code, cleaner, shorter, less complex and it will pop 2 for you much better. BTW, I think the issue with yours is that you are using 1 function (window.screen) that sets the width and height for any window that is opened whether it is the top or bottom window. You would have to duplicate that function and do some simple renaming to get it to work. AND, the fact that both windows are named "about:blank" does not help - you should try to give a window that opens (if more than 1) a different name so it does not try to open it into the same window that just opened. The code I give is way more friendly than what you want to use.

<script LANGUAGE="JavaScript">

var exit=true;
function popup1() {
if (exit)
window.open("YOUR FILE","blank1",",HEIGHT=200,WIDTH=500, resizable, screenX=0,screenY=0,top=0,left=0");}
<!--- set your file locatoin and window name and size and xy locatoin -->

var exit=true;
function popup2() {
if (exit)
window.open("YOUR FILE","blank2",",HEIGHT=114,WIDTH=275, resizable, screenX=0,screenY=0,top=0,left=50");}
<!--- set your file locatoin and window name and size and xy locatoin -->

</script>

<BODY onLoad="popup1();popup2()">
<!--- here is the onload call to pop the window --->