How to stop a Timer-X timer (jQuery)
Posted
by
Damien K.
on Stack Overflow
See other posts from Stack Overflow
or by Damien K.
Published on 2010-12-26T00:35:52Z
Indexed on
2010/12/26
0:54 UTC
Read the original article
Hit count: 199
JavaScript
|jQuery
I'm using Timer-X's timerDelayCall function in order to have a repeating rotator on my page, which starts automatically as the page loads:
jQuery.timerDelayCall({
interval: 2000,
repeat: true,
callback: function(timer) {
... (my rotator logic here)
}
}
});
The problem is that I'm trying to make a function that includes stopping that timer:
function signUp() {
... (timer stop code here)
}
The documentation stats that timer.stop()
does that, but however I format it, I get errors about it not being declared.
I have tried every variation I can think of, such as:
timer.stop();
jQuery.timer.stop();
$(document).timer.stop();
jQuery.timerDelayCall({ callback: function(timer) { timer.stop() } });
I'm sure I'm missing something simple - I come from a PHP background yet I'm new to javascript - but can't see what it is exactly. Help is much appreciated!
© Stack Overflow or respective owner