Re: small script question. need proper syntax
From: odyssey (paul.dallaire_at_sympatico.ca)
Date: 08/04/04
- Next message: Dennis: "Re: FP03 screws up the html"
- Previous message: aka: Crash Gordon®\: "Re: Publishing subweb"
- In reply to: Andrew Murray: "Re: small script question. need proper syntax"
- Next in thread: Jens Peter Karlsen[FP-MVP]: "Re: small script question. need proper syntax"
- Reply: Jens Peter Karlsen[FP-MVP]: "Re: small script question. need proper syntax"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 3 Aug 2004 20:51:59 -0400
HI! ok, I see that I am not explaining what I want properly. so I will give
the whole piece and what it does. ( all I want is the proper way to 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/background
_files/background_blue_1.jpg";
}
if (Wvalue==640&&Hvalue==480) {
image="../../../../../../../../../../../../../secondchance/images/background
_files/background_blue_2.jpg";
}
if (Wvalue==1024&&Hvalue==768) {
image="../../../../../../../../../../../../../secondchance/images/background
_files/background_blue_2.jpg";
}
if (Wvalue==1080&&Hvalue==1024) {
image="../../../../../../../../../../../../../secondchance/images/background
_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
"Andrew Murray" <SPAMadBUSTERmurray@iinet.net.au> wrote in message
news:410ecd2e$0$16329$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
> 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.
>
> "odyssey" <paul.dallaire@sympatico.ca> wrote in message
> news:B2tPc.7625$Jq2.387591@news20.bellglobal.com...
> > 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
> >
> > "MD Websunlimited" <none@none.com> wrote in message
> > news:OOdQ4ZIeEHA.328@TK2MSFTNGP12.phx.gbl...
> > > 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
> > >
> > > "odyssey" <paul.dallaire@sympatico.ca> wrote in message
> > news:YvlPc.4777$Jq2.303644@news20.bellglobal.com...
> > > > 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/backgr
> > > > ound_blue_640x480.jpg";
> > > >
> > > > else
> > > >
> >
image="../../../../../../../../../../../../../images/background_files/backgr
> > > > ound_blue_640x480.jpg";
> > > >
> > > > Thanks :)
> > > >
> > > > odyssey
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: Dennis: "Re: FP03 screws up the html"
- Previous message: aka: Crash Gordon®\: "Re: Publishing subweb"
- In reply to: Andrew Murray: "Re: small script question. need proper syntax"
- Next in thread: Jens Peter Karlsen[FP-MVP]: "Re: small script question. need proper syntax"
- Reply: Jens Peter Karlsen[FP-MVP]: "Re: small script question. need proper syntax"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|