Code Monkey home page Code Monkey logo

Comments (7)

RiaanP avatar RiaanP commented on June 23, 2024

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.

from simple-text-rotator.

RiaanP avatar RiaanP commented on June 23, 2024

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.

from simple-text-rotator.

desduvauchelle avatar desduvauchelle commented on June 23, 2024

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

from simple-text-rotator.

RiaanP avatar RiaanP commented on June 23, 2024

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..

from simple-text-rotator.

timucingelici avatar timucingelici commented on June 23, 2024

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);

from simple-text-rotator.

bouvens avatar bouvens commented on June 23, 2024

Thanks you for solution!

from simple-text-rotator.

jiyooooon avatar jiyooooon commented on June 23, 2024

@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

from simple-text-rotator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.