typewriterjs icon indicating copy to clipboard operation
typewriterjs copied to clipboard

Loop without deleting

Open plagasul opened this issue 4 years ago • 1 comments

Hello, thank you very much for the plugin, very useful.

I assume this is a feature request. I would like to be able to loop without deleting, to achieve appending random text to an already written element within the TypewriterJS object.

Something such as:

var sentences = ['this first sentence', 'this second sentence', 'this third sentence', 'etcétera']

var type = new Typewriter(el, {
  loop: true,
  deleteAll: false /* for example */
});      

type
  .pauseFor(500)
  .typeString(sentences[Math.floor(Math.random() * sentences.length)])
  .start();

This can be achieved now by wrapping the queue within a setInterval function, tho.

Thank you

plagasul avatar Mar 17 '20 13:03 plagasul

I would also like this feature. Or to trigger the delete in a callback

claytron5000 avatar Apr 11 '20 14:04 claytron5000