'for' loop in queue, issue with replacing span tags
<p>I am trying to do some tricky things with animations in a queue function. I hesitated to post my original code here since it's long and messy. But I've boiled down the problem I'm having to the following example (I'm coding the queue using this method by Alnitak: <a href="http://stackoverflow.com/questions/10972961/jquery-code-stops-working-after-adding-delay-and-removeclass/10973084#10973084">jQuery: code stops working after adding delay() and removeClass()</a>):</p>

<p><a href="http://jsfiddle.net/AYMY7/6/" rel="nofollow">http://jsfiddle.net/AYMY7/6/</a></p>

<p>This is an attempt to write a program that will animate the prime power factorization of 100. It's constructed with a for loop in which the #target div receives new html each time with 'span' tags around the piece that needs to be replaced. Then the 'span'ned part is supposed to fade out, be replaced by something, and fade in. If you run it you'll see that fade in/out only works the first time in the loop and then stops. My guess is that it is because when the next iteration replaces the html in the #target div, the 'span' tags are treated as something new and not affected by the original 'span' queue. I don't know if that made any sense, but if you study the code and run it, you'll see what I mean.</p>

<p>I've tried fixing it with classes and id's but I think the same core problem is still there. Can anyone see a way to fix this? </p>

<p>I thought I fixed it by adding separate div's for each piece and changing the array:</p>

<p><a href="http://jsfiddle.net/nQjBw/2/" rel="nofollow">http://jsfiddle.net/nQjBw/2/</a></p>

<p>This just about works great, except there are these little twitches that seem to happen randomly. So if someone can see how to fix this instead that would be awesome.</p>

<p>In either case I need a solution that isn't specific to factoring numbers, as I'm trying to use this method for a bigger project.</p>

<p>Thanks!</p>
