$("#type").each(function() { var $this = $(this); var str = $this.text(); $this.empty().show(); str = str.split(""); str.push("|"); // increase the delay to ghostType slower var delay = 100; $.each(str, function(i, val) { if (val == "^") { // Do nothing. This will add to the delay. } else { $this.append('<span>' + val + '</span>'); $this.children("span").hide().fadeIn(100).delay(delay * i); } }); $this.children("span:last").css("textDecoration", "blink"); });
p{margin:25px;}
<p id="type">こんにちは!^^^^かちびと.netです。^^^^^^^^^^ 管理者はおじさんです</p>