Display a sentence, one character at a time

后端 未结 6 2086
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-10 03:00

I want to display a sentence one character at a time, one by one, with jQuery. Is there a plugin that can do this Or how could I get this effect?

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-10 03:38

    I created a neat little js library recently with no dependencies that solves this minimalistically. Check out Sequencr.js

    var stringToPrint = "Hello World!"
    Sequencr.for(0, stringToPrint.length, function(i) {
      document.getElementById("output").innerHTML += stringToPrint[i];
    }, 200, null);
    
    
    
    
    
    

提交回复
热议问题