Closed Thread Icon

Preserved Topic: Having trouble with setTimeout again: (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18477" title="Pages that link to Preserved Topic: Having trouble with setTimeout again: (Page 1 of 1)" rel="nofollow" >Preserved Topic: Having trouble with setTimeout again: <span class="small">(Page 1 of 1)</span>\

 
PhotoChild
Bipolar (III) Inmate

From: The Moldy, Rainy State
Insane since: Aug 2000

posted posted 08-30-2001 06:49

Okay, I just rebuilt the main menu on my website to save space, (old one was 370K, new one is only 170K), but when I tried to implement a setTimeout function on the roll-over, it didn't work. It pauses on the intermediary picture?!? Anyway, here is what is is supposed to do, (minus time-out function):
http://www.focallimelight.com/mainmenu.html

And here is what it does when I tried implementing the time-out function:
http://www.focallimelight.com/mainmenu2.html

Can anyone help me figure out how to use this function properly?

Thanks!


mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-30-2001 08:20

You should modify setTimeout() functions to look like this:

swapIn() function:

setTimeout('document.images['+names[6]+'].src = jewel[6].src',100);
setTimeout('document.images['+names[6]+'].src = jewel['+jewelflop+'].src',0);

swapOut() function:

setTimeout('document.images['+names[6]+'].src = jewel[6].src',100);
setTimeout('document.images['+names[6]+'].src = jewel[0].src',0);


PhotoChild
Bipolar (III) Inmate

From: The Moldy, Rainy State
Insane since: Aug 2000

posted posted 08-30-2001 10:25

I made the changes, (though I'm not sure what they specificaly instruct the code to do differently), but it still doesn't work. The changes can be seen at:
http://www.focallimelight.com/mainmenu2.html

Did I do something wrong??



mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-30-2001 16:51

Ahhh, I was in a hurry and forgot to put quotations marks, the correct code would be:

swapIn() function:

setTimeout('document.images["'+names[6]+'"].src = jewel[6].src',10);
setTimeout('document.images["'+names[6]+'"].src = jewel['+jewelflop+'].src',0);

swapOut() function:

setTimeout('document.images["'+names[6]+'"].src = jewel[6].src',10);
setTimeout('document.images["'+names[6]+'"].src = jewel[0].src',0);

BTW I think that you should reverse timing, since the first image would appear after the second...

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-30-2001 19:55

Setting setTimeout with a time interval of zero is sort of pointless, you can take that out of the setTimeout function, probably.

PhotoChild
Bipolar (III) Inmate

From: The Moldy, Rainy State
Insane since: Aug 2000

posted posted 09-09-2001 10:31

Thanks, Max! It works great now, I really appreciate you taking the time!


mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 09-09-2001 15:24

No problem, heh...

« BackwardsOnwards »

Show Forum Drop Down Menu