Tag Archive for 'cleartimeout()'

15
Feb

Creating timers using the setTimeout method

In a previous example, “Creating timers using the setInterval() method”, we saw how you can create a repeating timer using the setInterval() method.

In the following example, you will see how to create and cancel non-repeating timers using the setTimeout() and clearTimeout() methods. You’ll also see how you can pass additional parameters to the setTimeout() method which will get passed along to your custom function.

As pointed out by a keen reader in the previous example, the setInterval() and setTimeout() methods are the non-preferred methods of timers. The new and improved method is to use the Timer class.

Full code after the jump.

Continue reading ‘Creating timers using the setTimeout method’




December 2008
M T W T F S S
« Nov    
1234567
891011121314
15161718192021
22232425262728
293031  

Badge Farm

  • Firefox 2
  • Powered by Redoable 1.2
  • Feeds burnt by Feedburner
  • Feed