[thelist] [Javascript] swicthing off a function
Hershel Robinson
hershelr at netvision.net.il
Thu Jan 15 06:58:21 CST 2004
> The idea is that if 'inuse' is off (equal to 0) the function should
> end - which stops the looping.
>
> Hope that makes more sense.
I read your code. The code you have written does precisely as it should.
When there's a rollover it stops, when there's a rollout, it starts.
Make sure you leave your mouse ON the image for the full 2 seconds, or you
could end up with cycles. Because the setTimeout didn't have time to see
that you rolled over.
It might be smarter to consider using a variable to hold your timeout and
then using clearTimeout to end that timeout onrollover.
Hershel
More information about the thelist
mailing list