Skip to content

Examples: Reveal Text

Susan E. McGregor edited this page Feb 13, 2014 · 4 revisions

examples/reveal_text

live demo

The reveal_text example demonstrates how to add a "reveal" effect to data docs text, so that words or phrases in an individual text div appear in sequence rather than all at once. To review the process for adding text, changing its font and adjusting its timing in the video, refer to the instructions for the simple_text example above. Once you've got all the timing, positions and appearance set, just do the following:

  1. In one of the text divs inside your dd_reveal_text.html file, add pipes (|) wherever you want there to be a delay in the text's appearance.

  2. In the main.js file, make sure that each addSalt method has two added parameters: has_reveal: "true" and reveal_timeout: 300 (where 300 is the number of milliseconds' delay between text snippets revealed. The delay can be different for each piece of text, and you can mix "reveal" text with "simple" text in any combination you like within a DataDoc.

  3. Open up your dd_reveal_text.html file in your browser, and check out your DataDoc!

Clone this wiki locally