Topic awaiting preservation: setTimeout X many, all bad. (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: Brisbane, Australia |
posted 06-01-2002 13:44
Ok, I seem to be having a re-occuring problem with setTimeout's... |
Paranoid (IV) Mad Scientist From: Somewhere over the rainbow |
posted 06-01-2002 15:30
The poster has demanded we remove all his contributions, less he takes legal action. |
Maniac (V) Lord Mad Scientist Sovereign of all the lands Ozone and just beyond that little green line over there... From: Stockholm, Sweden |
posted 06-01-2002 15:34
OK, I've dealt with this, and have a work-around that suits me. It uses the dreaded "eval()" function, which raises the hackles of several of our coders here (I won't mention Slime by name ;-) but this may be one of the only really good uses for this function! |
Maniac (V) Inmate From: Brisbane, Australia |
posted 06-01-2002 15:54
Wow, thanks for the quick replys. |
Maniac (V) Inmate From: Brisbane, Australia |
posted 06-01-2002 17:58
Been thinking about what you said above InI. |
Paranoid (IV) Mad Scientist From: Somewhere over the rainbow |
posted 06-01-2002 18:26
The poster has demanded we remove all his contributions, less he takes legal action. |
Maniac (V) Inmate From: Brisbane, Australia |
posted 06-01-2002 18:31
Cool. That's an interesting way of animating things. I think I'll have to play around with that at some point. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 06-01-2002 19:18
It's slow and makes code hard to read, and way overused (there is almost always another way to go about doing something that looks cleaner and works faster). |
Maniac (V) Lord Mad Scientist Sovereign of all the lands Ozone and just beyond that little green line over there... From: Stockholm, Sweden |
posted 06-01-2002 22:22
Yah, InI's method works great, I did this page http://changeminds.com/glassPlay/blobs2.shtml after another marathon discussion we had, where all of our "javascript gurus" got to participate, this multi-rollover page was the result. Bascially, we build an array with the values of which image in an array *should* be showing now, and then on a setInterval we check every image on the page to see if it needs adjusting, and then only change the ones needing it. When you mouseover a link, you don't tell it to switch an image, nothing so crude! Instead you tell it that the image it *should* be showing is #5 in the series, and on mouseout you tell it #1. The setInterval runs all the time, adjusting things as needed. |
Maniac (V) Inmate From: Brisbane, Australia |
posted 06-02-2002 05:30
Wow, that's downright funky! |