DHTML : Text with wave effects
Contents ]
Mickaël le Moal

Parameters

First of all, we must define a few parameters used by our script, which the animation depends on. They are used for positioning the text on the page and determining the type of movement that will be applied to it.

  7: var type=1;
  8: var nb_obj = 10;
  9: var x = 170;
10: var y = 100;
11: var sep = 25;

Here is a description of these important parameters:

  • type. The type of animation to use.

  • By modifying the value of this variable by assigning it 1, 2 or 3, you can change the type of animation. Test each value to see which type best suits your site.

  • nb_obj. The number of letters (including spaces) in the text to be animated.

  • x. The horizontal position of the text, i.e. its distance from the left border of the browser's window.

  • y. The vertical position, i.e. the distance from the top border of the browser's window.

  • sep. The distance between each letter of the text.

Unnecessary letters? The x and sep parameters have no effect in Internet Explorer: this browser will automatically place the animation in the centre of the window. Conversely, Netscape Navigator will take these two parameters into account when positioning the text.



1   2   3   4