Click to See Complete Forum and Search --> : Help Required! PLEASE!!!!


shard
03-21-2003, 08:11 PM
Hi every1!
I am a newbie in JavaScript and thus need ur help on the following issue:

i have written this code in my index.htm file:





<script language = "JavaScript">

function openw() {
w = screen.width;
h = screen.height;

if (w >= 1280 && h >= 1024) {
finalw = 800
finalh = 400
}
else if (w >= 1024 && h >= 768) {
finalw = 600
finalh = 400
}
else if (w >= 800 && h >= 600) {
finalw = 400
finalh = 200
}
else {
finalw = 200
finalh = 100
}
window.open ('main.htm','','width='+finalw+',height='+finalh);
}

function makeNewWindow() {

var n_win;
var windowProps;


windowFeatures = "top=0, left=0, resizable=no" +",width=" + (window.innerWidth = screen.width)+",height=" + (window.innerHeight = screen.height);
newWindow = window.open ("main2.htm",'',windowFeatures)
newWindow.focus();

}


these 2 fucnctions r working correctly... but the only problem is that a pc doesn't use the full resolution while opening a browser window... thus if on 1280x1024 a popup window appears having the same width and height... some of the window isn't visible! u can visit www.themightythor.com to see what i exactly want. when u enter this site... the window resizes to the resolution u r currently using and keeps itself on top! i have tried reading its script but its way too advanced for me....

please guyz... this thing is killing me!!! please help me with this!!! i have already tried using window.innerHeight and width but it didn't work!

Jona
03-21-2003, 08:40 PM
Just put this in your main page:

newwin.innerWidth = screen.width;
newwin.innerHeight = screen.height;
newwin.screenX = 0;
newwin.screenY = 0;

shard
03-21-2003, 09:00 PM
well thankyou brother for ur kind help and time... ur code did work but only for width... yes the width is now equal to the used resolution but the height is the same as before and thus some of it contents are not fully visible!

please tell me what to do now!?!??!

Jona
03-21-2003, 09:02 PM
It should work for both. Double-check your code for typos.

shard
03-21-2003, 09:11 PM
no typos for sure sir! checked it again and again... infact now i realized that it isn't workin for neither one... it looked as if it was workin' for the height! what does the function newwin do? can't we use it in the function nw() in the page that triggers main.htm/main2.htm pages????

Jona
03-22-2003, 12:59 AM
Oh, duh, change newWin to newWindow

shard
03-22-2003, 03:55 PM
lol! i think i did mention in my thread that i was a newbie...! anywayz changing newWin to newWindow doesn't work neither! i am using win2000 pro with IE 6.0 and a monitor resolution of 1280x1024.... is that a problem?