...

View Full Version : window size



compgeek
03-07-2009, 10:20 PM
ok i have a page that opens another page without the toolbars, however the issue is that i dont know how to make them different sizes, like this page im including here is too small for what is actually on the page. I have to maximize the window. How do i html the code for the size page i want it to be. I hope I am sayong that correct


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home Certification</title>



</head>

<script language="JavaScript">
function loadMainWindow()
{
var win = window.self;
win.opener = window.self;
var newloc = "http://clas0as21.corp.cox.com/sdchealtop/framework/frameset.asp";
var ih = (window.window.screen.availHeight - 60) - 100;
var iw = (window.window.screen.availWidth - 10) - 100;
var it = ((window.window.screen.availHeight - 60) - ih) / 2;
var il = ((window.window.screen.availWidth - 10) - iw) / 2;
var features =
"directories=no,menubar=no,location=no,toolbar=no,status=yes,scrollbars=yes*,resizable=yes"
+ ",width=" + iw + ",height=" + ih + ",top=" + it + ",left=" + il + "";
v1 = new Date();
v2 = Date.parse(v1);
v3 = "pg" + v2;
var oNewWindow = window.open(newloc, v3, features);
oNewWindow.focus();
win.close();


}


function window.onload()
{
try
{
loadMainWindow();
}
catch(e)
{
popUpMessage.style.display = 'You Are Being Redirected!';
}

}


</script>

Rowsdower!
03-07-2009, 10:31 PM
Well based on this:
var features =
"directories=no,menubar=no,location=no,toolbar=no,status=yes,scrollbars=yes*,resizable=yes"
+ ",width=" + iw + ",height=" + ih + ",top=" + it + ",left=" + il + "";

It looks like height, width, and screen position is determined just with a mathematical function based on this part of the code:
var ih = (window.window.screen.availHeight - 60) - 100;
var iw = (window.window.screen.availWidth - 10) - 100;
var it = ((window.window.screen.availHeight - 60) - ih) / 2;
var il = ((window.window.screen.availWidth - 10) - iw) / 2;

Try altering the values in red and see if your results improve. It looks like those two sections control the window size and the other two sections control the window placement on the screen.

compgeek
03-07-2009, 10:47 PM
unfortunatley neither worked. i tried to mess withte section below and when i did it put the window way to big my screen res is 1680 x 1050 and i had:


var features =
"directories=no,menubar=no,location=no,toolbar=no,status=yes,scrollbars=yes*,resizable=yes"
+ ",width=900" + iw + ",height=600" + ih + ",top=" + it + ",left=" + il + "";

so then i went to the other section and it did nothing,



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum