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

Repeating a function? #5

Open
doubleedesign opened this issue Nov 7, 2011 · 0 comments
Open

Repeating a function? #5

doubleedesign opened this issue Nov 7, 2011 · 0 comments

Comments

@doubleedesign
Copy link

Hi,
I love the typewriter function, it's perfect for a current project.
However, I'd like to get it to repeat after a set amount of time. What's the best way to do this?

I tried wrapping a function around the part that goes in the tags of the HTML pge and using setTImeout like so:
announcement();
function announcement() {
$(document).ready(function() {
$("#content #announcement h2").typewriter();
});
setTimeout("announcement()", 10000);
}

but after a few rounds, the typewriter would stop one character before the end, then the next time two characters before the end, etc. I'm very new to JavaScript so am stumped by this one, didn't think it would be so hard just to get something to repeat :(

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

1 participant