Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Fade' animation skip #1

Closed
svinkle opened this issue Sep 25, 2013 · 7 comments
Closed

'Fade' animation skip #1

svinkle opened this issue Sep 25, 2013 · 7 comments

Comments

@svinkle
Copy link

svinkle commented Sep 25, 2013

I noticed the 'fade' animation seems to skip every other item in the list. Not sure what's up with that.

@RiaanP
Copy link

RiaanP commented Sep 26, 2013

I can corroborate svinkle's issue. There's something wonky with the 'fade' transition. I'll try and take a look later.. might commit if I can spot the issue.

@RiaanP
Copy link

RiaanP commented Sep 26, 2013

If I add a console trace I get double figures being traced back... it appears as though sometimes the setInterval is fired twice and then keeps running like that.

@desduvauchelle
Copy link

Same here. Any solutions yet?
I took a look, it's so clean that I can't find how to fix :)

@RiaanP
Copy link

RiaanP commented Nov 4, 2013

Ok I found a solution for this issue. The setInterval on line 162 fires at the exact same time as the fade animation and that causes the counter to incrememnt twice.
Online 162, replace the setInterval... bit with this: setInterval(rotateMe, settings.speed*2); // Wait twice as long.

That fixes the fading, at least it did for me..

@timucingelici
Copy link

Hi there,

The fadeOut callback runs twice because that callback fires another fadeIn. So just change this part;

el.fadeOut(settings.speed, function() {
index = $.inArray(el.text(), array)
if((index + 1) == array.length) index = -1
el.text(array[index + 1]).fadeIn(settings.speed);
});

with this;

el.fadeOut(settings.speed, function() {
index = $.inArray(el.text(), array)
if((index + 1) == array.length) index = -1
el.text(array[index + 1]);
}).fadeIn(settings.speed);

@bouvens
Copy link

bouvens commented Nov 26, 2013

Thanks you for solution!

@svinkle svinkle closed this as completed Mar 1, 2015
@jiyooooon
Copy link

@timucingelici Thank you for this solution. This should be implemented in https://github.com/peachananr/simple-text-rotator/blob/master/jquery.simple-text-rotator.js asap to avoid future confusion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants