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

Delay start? And stop on last word? #18

Open
madithompson opened this issue May 12, 2014 · 3 comments
Open

Delay start? And stop on last word? #18

madithompson opened this issue May 12, 2014 · 3 comments

Comments

@madithompson
Copy link

Hi there,

Was just wondering if you could instruct me how to delay the start of the function. And then also stop on the last word in the string.

Many thanks!

@martinbertinat
Copy link

Hi, I want to stop on the last word too. @madithompson Did you found a solution? thanks!

@dunksmith
Copy link

Check out my fork: https://github.com/dunksmith/simple-text-rotator

It adds three new settings which should help: text, repeat and onFinish.

Usage:

<span class="rotate" data-text="one, two, three!">one</span>
$(".rotate").textrotator({
    animation: "flipUp",
    speed: 800,
    text: $(".rotate").data('text'),
    repeat: false,
    onFinish: function () {
        // ...
    }
});

This gives you two things:

  1. You can now delay the call to textrotator using setTimeout(function() {...}, delay) - because of the text setting, the HTML will look fine until it kicks in.
  2. You can avoid repeating by setting text to false, optionally using onFinish to start it again (through a recursive call to textrotator) after a delay.

Might not be exactly what you need, but it will hopefully get you on the right track.

@BryanBarrera
Copy link

Thanks! This helped me! @dunksmith

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

4 participants