|
|
@ -812,9 +812,7 @@ const typewrite = (elementsRef, message, callback) => { |
|
|
|
count++ |
|
|
|
count++ |
|
|
|
elementsRef.innerText = message.substr(0, count) |
|
|
|
elementsRef.innerText = message.substr(0, count) |
|
|
|
// scroll when new line ` <br>
|
|
|
|
// scroll when new line ` <br>
|
|
|
|
if (elementsRef.lastChild.tagName === `BR`) { |
|
|
|
if (elementsRef.lastChild.tagName === `BR`) callback() |
|
|
|
callback() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (message.length === count) { |
|
|
|
if (message.length === count) { |
|
|
|
clearInterval(id) |
|
|
|
clearInterval(id) |
|
|
|
callback() |
|
|
|
callback() |
|
|
|