Wednesday, October 10, 2007

window.setInterval()

Set a delay for a specific function.

Syntax
ID = window.setInterval("funcName", delay)

Parameters
funcName is the name of the function for which you want to set a delay.
delay is the number of milliseconds (thousandths of a second) that the function should be delayed.
ID is the interval ID.

Example
intervalID = window.setInterval("animalate()", 500);

Notes
The interval ID is used to refer to the specific interval when it needs to be cleared. The setInterval() function is commonly used to set a delay for functions that are executed again and again, such as animations.
blog comments powered by Disqus