Posts Tagged ‘clearTimeout()’

Javascript Timers

Posted on March 6th, 2010 by Eric Rowell

Javascript timers can be very handy when developing advanced scripts. I’ve found that timers are most useful when creating RIA (rich internet application) elements, like making a div fade out over a period of a few seconds, waiting a small period of time to hide a div, or waiting a short period of time to initialize a specific Javascript function. The key to creating a Javascript timer is the setTimeout() function. It takes two parameters. The first parameter is the function that the timer will call, and the second parameter is the number of milliseconds to wait before calling.