TheZillionが提供する単純なタイピング効果スクリプトを使用しています。
<html>
<head>
<title>Typing Effect - by Zillion</title>
<script type='text/javascript'>
var index = 0;
var text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque tincidunt, nulla at tempus tristique, nisl leo molestie est, ut vestibulum mauris mauris a odio. Sed at massa vitae ipsum venenatis porta. Integer iaculis pretium tempus. Donec viverra sollicitudin velit non gravida. Phasellus sit amet tortor odio. Vivamus lectus nisl, suscipit porttitor bibendum ut, tristique quis dui. Vestibulum non eros leo. Maecenas tincidunt semper turpis, a tristique purus pretium sit amet. Praesent nec neque tortor.Donec suscipit tristique ante quis molestie. Phasellus ac lacus non felis faucibus dictum vitae ac ipsum. Sed pharetra nulla sodales nulla porta imperdiet. Quisque pretium hendrerit laoreet.';
// Here you can put in the text you want to make it type.
function type() {
document.getElementById('screen').innerHTML += text.charAt(index);
index += 1;
var t = setTimeout('type()', 100);
// The time taken for each character here is 100ms. You can change it if you want.
}
</script>
</head>
<body onload='type()'>
<!-- And here, you create the container in which you display the typed text -->
<div id='screen'></div>
</body>
</html>
文字列に改行を追加したいと思いvar text
ます。
現在、"\n", "\r",
Unicode 表現または HTML タグは認識されていません。
また、文字列に入力されている文字の前に点滅するカーソルを追加したいと思いvar text
ます。
どんな助けでも大歓迎です。
これがjsFiddleのコードです