jquery-typewriter icon indicating copy to clipboard operation
jquery-typewriter copied to clipboard

Stop writing function

Open HardlyMirage opened this issue 14 years ago • 1 comments

I tried implementing a stopTypewriting function by assigning and returning the setTimeout variable during initialization, then clearing it when the function is called. But it's messing things up.

Any chance you could write up a stopTypewriting function or provide pointers on how it can be implemented?

Thanks!

HardlyMirage avatar Jun 07 '11 09:06 HardlyMirage

Well, every call to setTimeout (every printed character) will result in a new id, and only the newest one will cancel it.

So I think the options are either a global variable, or assigning a class at the start of the function and only applying operations to things in that class; then the stopTypewriting function would just remove that magic class.

Not sure which is more of a hack.

chadselph avatar Jun 07 '11 10:06 chadselph