I have a <div>
with text.
<div>
to be revealed on the page one character at a time:<div>
, the animation should stop and display the full text instantly.In summary, I aim to replicate an effect commonly seen in Japanese-style adventure games known as a typewriter or teletype effect. A good example can be viewed here:
http://www.youtube.com/watch?feature=player_detailpage&v=SasgN0lim7M#t=418
While I could achieve this animation using JavaScript by setting up a timer to append letters (or words) sequentially, I am curious if it's possible to accomplish the same effect with CSS in modern browsers. Modifying the element class in the
onclick
function with JavaScript would also be acceptable.Update: To clarify the difference between characters and letters and address concerns about HTML entities:
The text contains several HTML elements, such as:
Lo­rem <i>ip­sum</i>.
A straightforward method of adding text character-by-character to the
innerHTML
wouldn't work as expected:L Lo Lo& ...Oops!