sent it to a default image)
Now. the code below checks if the users resolution matches any of the
below values and if so it loads the given image. now what if the user
has a rez that is not listed below? at this point as the code is it
would not load any image at all right?
So I need to add else statement so if the user does not have any of the
sez below it would at least load one image that I define as a default
image.
How do I add the ELSE statement?
Below is the in a js file.
-----------------------------------------Start of code-----------------
var Wvalue=(0) var Hvalue=(0) Wvalue=screen.width Hvalue=screen.height
var image=""; if (Wvalue==800&&Hvalue==600) {
image="../../../../../../../../../../../../../secondchance/images/backgr
ound
_files/background_blue_1.jpg";
}
if (Wvalue==640&&Hvalue==480) {
image="../../../../../../../../../../../../../secondchance/images/backgr
ound
_files/background_blue_2.jpg";
}
if (Wvalue==1024&&Hvalue==768) {
image="../../../../../../../../../../../../../secondchance/images/backgr
ound
_files/background_blue_2.jpg";
}
if (Wvalue==1080&&Hvalue==1024) {
image="../../../../../../../../../../../../../secondchance/images/backgr
ound
_files/background_blue_4.jpg";
}
document.open();
document.write("<BODY BACKGROUND='"+image+"'>");
document.write("<CENTER><\/CENTER>");
----------------------------------------------------------End of
code--------------------
Thanks for the responses guy and your patience
odyssey
ok...so the else clause should surely point to an image like
800_600image.jpg not
640_480image.jpg?
as has been pointed out, they are pointing to the same image so
whatever resolution the user has, the 640_480image.jpg is going to
load.
No. that's not what I meant. there are actually several IF
statements
and I
want a default one. if the nothing matches the what is in the if
statements
I want it to default to 800x600 screen rez.
odyssey
Nothing changes because both are pointing to the same image.
--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible
HI! below is a part of a script that I need to add an else
statement
so
that
if a different rez is detected that does not match any of the IF
statement
that it will default to the one that I specify.
I tried just putting an else statement with the line I want but
it
does
not
work can someone correct me?
if (Wvalue==640&&Hvalue==480) {
image="../../../../../../../../../../../../../images/background_files/ba
ckgr
ound_blue_640x480.jpg";
else
image="../../../../../../../../../../../../../images/background_files/ba
ckgr
ound_blue_640x480.jpg";
Thanks
odyssey