0

OK, I don't have any problems with reading and testing (works like a charm) the question changing-text-periodically-in-a-span-from-an-array-with-jquery. The problem is when I want to change two divs, not just one. It jumps not as 0,1,2,3,4,5, but as 0,2,4 and it is not clear for me why. Here is a jsFiddle code

If I remove ct== terms.length -1 ? 0 : ct+ 1 as a second validation, it doesn't help.

So how to make it run 0,1,2,3,4,5?

Thank you.

Community
  • 1
  • 1
Haradzieniec
  • 9,086
  • 31
  • 117
  • 212

4 Answers4

1

You are calling rotateTerm twice (once in each fadeOut): http://jsfiddle.net/Dv2KV/4/

Royce Feng
  • 1,663
  • 1
  • 10
  • 6
1

You were running rotateTerm twice - once for each animation completing. I fixed that and also removed the bit that sets the term data variable on title-content as it's not needed...

http://jsfiddle.net/Dv2KV/2/

Reinstate Monica Cellio
  • 25,975
  • 6
  • 51
  • 67
1

You're calling rotateTerm twice each time through. You'll need to use separate functions or only call rotateTerm once.

Femi
  • 64,273
  • 8
  • 118
  • 148
1

Simply because your function "rotateTerm" are called two time (fadeOut callback) !

http://jsfiddle.net/Dv2KV/6/

Akarun
  • 3,220
  • 2
  • 24
  • 25