Re: [jQuery] Re: How can i make a timer that i can stop with jquery?

2009-11-13 Thread Mark
Hey, Thanx for that code but i see one problem. It's not gonna work with multiple countdowns (which i have). Perhaps i need to send the animate object between the start and stop actions to be able to stop a certain animation (countdown)?? @Michael Geary i actually have that option working but

[jQuery] Re: How can i make a timer that i can stop with jquery?

2009-11-12 Thread MorningZ
Not really requiring jQuery, just read up on JavaScript's setInterval, which is like setTimeout except you can cancel it On Nov 12, 7:39 pm, Mark mark...@gmail.com wrote: Hi, i tried this jquery countdown plugin:http://davidwalsh.name/jquery-countdown-pluginand it works neat.. but not for

Re: [jQuery] Re: How can i make a timer that i can stop with jquery?

2009-11-12 Thread Michael Geary
Now MorningZ, that is possibly the worst comparison of setInterval() and setTimeout() that I've ever seen! (Please take that as a little good-natured ribbing among friends, OK?) Both setInterval() and setTimeout() are cancelable, using clearInterval() and clearTimeout() respectively. The

[jQuery] Re: How can i make a timer that i can stop with jquery?

2009-11-12 Thread MorningZ
it was admittedly a quick reply, but setInterval would be a path to take. sorry the verbose and novelized version wasn't typed out :-) On Nov 12, 8:39 pm, Michael Geary m...@mg.to wrote: Now MorningZ, that is possibly the worst comparison of setInterval() and setTimeout() that I've ever

[jQuery] Re: How can i make a timer that i can stop with jquery?

2009-11-12 Thread Phish
Hey Mark, The plugin uses a recursive function to achieve the countdown. You can cancel the countdown by checking a global variable with each decrement in the number. Line 19: $(this).animate({ 'fontSize': settings.endFontSize },settings.duration,'',function() {

[jQuery] Re: How can i make a timer that i can stop with jquery?

2009-11-12 Thread Phish
Great response, Mike. In the plugin that the OP mentioned, it uses neither, but uses a recursive function instead. To cancel the recursive function, one would need to use a variable, and check it's value with each recursive function call. I replied to this post earlier, but it didn't seem to