Display a sentence, one character at a time

后端 未结 6 2085
佛祖请我去吃肉
佛祖请我去吃肉 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:33

    This converts a string to an array, and writes out it out character at a time.

    var str = "This is a sentence".split('');
    
    for (var i=0; i < str.length; i++) {
        console.log(str[i]);
    };
    

    http://jsfiddle.net/44xEe/1/

提交回复
热议问题