Dynamic HTML Example : Timing Control

A means of controlling movement and/or visibility of styled DIVs, based on timed values, is an important element in creating dynamic web pages.

Creating a function using the javascript setTimeout method, and recursively passing this timing function parameters, is the basis for applying the timing feature.

Shown below is a function that selects a styled Div and moves it a preset distance for a specified number of steps.

Crab
Spider
Worm