You are calling  t=setTimeout("timedAnim(animatedLink)",getRandom());

And setTimeout will call function: timedAnim(animatedLink)

When it calls it, it calls the timedAnim() with the animatedLink value
which would be the last value it was set. In your case the last img's
reference.

See if this works:

$('.main_nav img').each(function(i) {
               $(this).css("opacity", 0);
               animatedLink[i] = this;
               t = setTimeout("timedAnim(animatedLink["+i+"])",getRandom());
});

----
Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com



On Mon, Feb 2, 2009 at 6:38 PM, re5et <[email protected]> wrote:
>
> this is what someone on the IRC channel said:
>
> <MadAtWork> You create n flicker timeouts, which all turn off/on the
> animatedLink item.
> <MadAtWork> Which is always the extra image.
> <MadAtWork> The callback is not "compiled" until it's invoked.
> <MadAtWork> And when it is, animatedLink is always the extra image.
>
> what does that mean?

Reply via email to