function TextInput(message, id) {
    var self = this;
    self.message = message || [];
    var l = message.length - 1;
    var j = 0;
    self.id = id;
    document.getElementById(id).innerHTML = '';
    self.ct = function(text) {
        var p = document.createElement('p');
        var span = document.createElement('span');
        var udline = document.createElement('span');
        udline.innerText = '_';
        var con = document.getElementById(self.id);
        con.appendChild(p);
        p.appendChild(span);
        p.appendChild(udline);
        var tl = text.length - 1;
        var i = 0;
        var interval = setInterval(function() {
            if (i === tl) {
                clearInterval(interval);
                p.removeChild(udline);
                j < l ? self.ct(message[++j]) : 0;
            }
            span.innerText += text[i++];
        }, 75, tl);
    };
}
TextInput.prototype.start = function() {
    this.ct(this.message[0]);
};
TextInput.prototype.getDelay = function() {
    var l = this.message.length;
    var delay = 0;
    for (var i = 0; i < l; ++i) {
        delay += this.message[i].length;
    }
    return delay * 75;
};
(function() {
    var message = [];
    message.push('欢迎来到小升初复读班小队的主页!');
    message.push('欢迎来到小升初复读班小队的主页!');
    message.push('欢迎来到小升初复读班小队的主页!');
    message.push('欢迎来到小升初复读班小队的主页!');
    message.push('欢迎来到小升初复读班小队的主页!');
    var textInput = new TextInput(message, 'text-container');
    textInput.start();
    setTimeout(function() {
    }, textInput.getDelay());
    var ywdmsg = ['写个代码改变世界', '前端小能手', '求大神带飞~'];
    var ywd = new TextInput(ywdmsg, 'ywd');
    var ywdlis = document.getElementById('ywd-listener');
    ywdlis.onmouseover ? ywdlis.onmouseover = function() {
        setTimeout(function() {
            ywd.start();
        }, 1000);
    } : ywdlis.addEventListener('mouseover', function() {
        setTimeout(function() {
            ywd.start();
        }, 1000);
    });
})();
@@ -151,56 +151,8 @@
 id;%0A
-    document.getElementById(id).innerHTML = '';%0A
     
@@ -880,24 +880,77 @@
 unction() %7B%0A
+    document.getElementById(this.id).innerHTML = '';%0A
     this.ct(

修复一个小BUG,其他BUG大家加油~