Note |
---|
title | Queues are timers... |
---|
|
The queue() function uses the timer functionality behind the scenes, so when you use removeTimer() it will remove both timers and queues for the specified function. |
Overview
Excerpt |
---|
Allows you to cancel all timers associated with a specific function. |
If there are multiple timers associated with a specific function, it's not possible to cancel one specific timer.
Syntax
Code Block |
---|
theme | Eclipse |
---|
language | javascript |
---|
linenumbers | true |
---|
|
removeTimer(functionName); |
Parameters
Parameter | Mandatory | Type | Description |
---|
functionName | | String | All timers (including queued function calls) associated with the named function (referenced by it's name in quotes) will be cancelled. |
Return value
It's not clear what the value will be, so don't do anything with it.Value | Type | Description |
---|
undefined | Undefined | The timers/queues associated with the function have been removed. |
<error> | Error | Did you forget to specify functionName as a string? |
Example
Code Block |
---|
theme | Eclipse |
---|
language | javascript |
---|
title | Setting / removing a timer |
---|
linenumbers | true |
---|
|
function foo() {
// do stuff
}
setTimer("foo",1000);
removeTimer("foo"); // cancel all timers that relate to function "foo" |
See also