Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


JavaScript - If... Then... Else problem.

 
Logged in as: Guest
arrSession:exec spGetSession 2,7,60347
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> JavaScript - If... Then... Else problem.
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 JavaScript - If... Then... Else problem. - 5/18/2008 9:56:20 AM   
  TKS


Posts: 154
Score: 0
Joined: 5/16/2008
Status: offline
Hi, the following code is pretty simple and self explanitory, but I haven't quite yet figured out why the delay1() function isn't working... what do you think is the problem?

- TKS


      
 
 
Post #: 1
 
 RE: JavaScript - If... Then... Else problem. - 5/18/2008 12:46:57 PM   
  TNO


Posts: 1067
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Whats not working exactly? I click the word and a loading image appears, then it changes to content. I click again and the display is toggled back and forth.

P.S. Would you like me to clean up your code? I'm a bit of a JS evangelist.

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to TKS)
 
 
Post #: 2
 
 RE: JavaScript - If... Then... Else problem. - 5/18/2008 1:15:50 PM   
  TKS


Posts: 154
Score: 0
Joined: 5/16/2008
Status: offline
quote:

ORIGINAL: TNO

Whats not working exactly? I click the word and a loading image appears, then it changes to content. I click again and the display is toggled back and forth.

P.S. Would you like me to clean up your code? I'm a bit of a JS evangelist.


Hi TNO,

If you toggle the word really fast the loading image that changes to content will eventually start swapping it's order with the showing of the content... "the order changes". So instead of the loading image showing first... the content shows then the loading image. And that looks really stupid!

So, I put in a SetTimeOut function to prevent that from happening, but I don't think it's working... perhaps I haven't done the if... then... else properly...

But if you can clean that up, that would be greatly appreciated.

-TKS

(in reply to TNO)
 
 
Post #: 3
 
 RE: JavaScript - If... Then... Else problem. - 5/18/2008 3:45:13 PM   
  TNO


Posts: 1067
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline

      

< Message edited by TNO -- 5/18/2008 3:48:52 PM >


_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to TKS)
 
 
Post #: 4
 
 RE: JavaScript - If... Then... Else problem. - 5/18/2008 4:02:11 PM   
  TKS


Posts: 154
Score: 0
Joined: 5/16/2008
Status: offline
quote:

ORIGINAL: TNO


      


Hi TNO,

Holy s**t, you cleaned my code up good!

Thanks.

-TKS

(in reply to TNO)
 
 
Post #: 5
 
 RE: JavaScript - If... Then... Else problem. - 5/18/2008 10:59:53 PM   
  TKS


Posts: 154
Score: 0
Joined: 5/16/2008
Status: offline
quote:

ORIGINAL: TNO


      


Hi TNO,

Ok, I've probed your code some bit, and I notice that when I replace the text (with id=target) it doesn't work.

Here's an example of what I've been doing:


      

-TKS

< Message edited by TKS -- 5/18/2008 11:01:16 PM >

(in reply to TNO)
 
 
Post #: 6
 
 RE: JavaScript - If... Then... Else problem. - 5/19/2008 5:50:14 AM   
  TKS


Posts: 154
Score: 0
Joined: 5/16/2008
Status: offline
quote:

ORIGINAL: TKS

quote:

ORIGINAL: TNO


      


Hi TNO,

Ok, I've probed your code some bit, and I notice that when I replace the text (with id=target) it doesn't work.

Here's an example of what I've been doing:


      

-TKS


Hey TNO,

Nevermind. I figured out why it wasn't working.

-TKS

(in reply to TKS)
 
 
Post #: 7
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> JavaScript - If... Then... Else problem. Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts