Very good simulated typing effect. Currently, only a friend of the plain text, BR tag, and P tag can be used urgently, so I wrote this effect and the Code has some improvements, you can try to modify it to make it more concise and then post it for sharing.
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <meta name = "Generator "CONTENT =" EditPlus "> <meta name =" Author "CONTENT =" "> <meta name =" Keywords "CONTENT =" "> <meta name =" Description "CONTENT = ""> <style type = "text/css"> body {margin: 0px; font: "" 12px; background-color: #000; color: # fff} </style> <script type = "text/javascript"> var typer = {contai Ner: null, speed: 100, innerHTML: null, curpos: 0, interval1: null, interval2: null, init: function (obj, speed) {typer. container = obj; if (speed) typer. speed = speed; typer. start () ;}, start: function () {typer. innerHTML = clearSpace (typer. container. innerHTML ). toLowerCase (); typer. container. innerHTML = ""; typer. interval1 = setInterval ("typer. type () ", typer. speed) ;}, type: function () {if (t Yper. curpos <typer. innerHTML. length) {if (typer. container. innerHTML. substring (typer. container. innerHTML. length-1 )! = "_") {Typer. container. innerHTML + = "_";} else {var tempStr = ""; if (typer. innerHTML. length> = typer. curpos + 4) {if (typer. innerHTML. substring (typer. curpos, typer. curpos + 4) = "</p>") {tempStr = "</p>"; typer. curpos = typer. curpos + 4;} else if (typer. innerHTML. substring (typer. curpos, typer. curpos + 4) = "") {tempStr = ""; typer. curpos = typer. curpos + 4;} else {if (typer. innerHTML. length> = typer. curpos + 3 & typer. inner HTML. substring (typer. curpos, typer. curpos + 3) = "<p>") {tempStr = "<p>"; typer. curpos = typer. curpos + 3;} else {tempStr = typer. innerHTML. substring (typer. curpos, typer. curpos + 1); typer. curpos ++ ;}} else if (typer. innerHTML. length> = typer. curpos + 3) {if (typer. innerHTML. substring (typer. curpos, typer. curpos + 3) = "<p>") {tempStr = "<p>"; typer. curpos = typer. curpos + 3;} else {tempStr = typer. innerHTML. substring (typer. Curpos, typer. curpos + 1); typer. curpos ++ ;}} else {tempStr = typer. innerHTML. substring (typer. curpos, typer. curpos + 1); typer. curpos ++;} typer. container. innerHTML = typer. container. innerHTML. substring (0, typer. container. innerHTML. length-1) + tempStr;} else {clearInterval (typer. interval1); typer. interval2 = setInterval ("typer. last () ", typer. speed) ;}, last: function () {if (typer. container. innerHTML. subst Ring (typer. container. innerHTML. length-1 )! = "_") Typer. container. innerHTML + = "_"; else typer. container. innerHTML = typer. container. innerHTML. substring (0, typer. container. innerHTML. length-1) ;}} function clearSpace (str) {if (str! = "") {Str = str. replace (/^ \ s */g ,""). replace (/\ s * $/g, "");} return str;} script </HEAD> <BODY onload = "typer. init (document. getElementById ('view') "> <p id =" view "style =" font: ''12px; background-color: #000; color: # fff "> name: Cold mail: cityvoice@hotmail.com Nationality: Hunan <p> hobbies: Play, travel, play interstellar, singing </p> </BODY> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]