Click to See Complete Forum and Search --> : Newbie Trouble :P


Atrox
01-30-2003, 09:11 PM
I'm new to Javascripting and having a little bit of trouble getting this ifcheck to work...


var height=screen.height;
var width=screen.width;
var minheight=1024;
var minwidth=768;

if (height < minheight && width < minwidth)
{
document.write("Please make your screen resolution bigger");
}
else if ((height < minheight) && (width < minwidth))
{
document.write("Please make your screen resolution bigger");
}
else
{
}


I don't get why it won't show anything, no errors or anything, just not showing.

Atrox
01-31-2003, 06:33 AM
No, I want and. I want it to make check to see if the height AND width is less than the minheight and minwidth.

Besides, that still wouldn't fix the problem with it not showing.

Charles
01-31-2003, 09:48 AM
If you use AND then the message will only show if both conditions are true; id est: if the screen is set to narrow but not to high then the message will not be shown.

Where are you putting that piece of script? In the document head? Are you calling it after the page has loaded?

ElectronShaman
01-31-2003, 01:03 PM
if (height < minheight) || (width < minwidth)

{
document.write("Please make your screen resolution bigger");
}

else if (height < minheight) || (width < minwidth)

{
document.write("Please make your screen resolution bigger");
}
else
{
}


Try This ^^

Atrox
02-01-2003, 06:55 AM
Originally posted by ElectronShaman
if (height < minheight) || (width < minwidth)


Yea... should be if ((height < minheight) || (width < minwidth))

but I got it working, I just erased it and re-wrote it. Works fine now, don't know why it didn't before.