Question

So I'm using keith wood countdown plugin.

$('#shortly').countdown({until: shortly,  
onExpiry: liftOff}); 

works as expected.

The thing is I need to disable the onExpiry when the user click on some button. I mean to break the countdown and not to execute the callback method, in the example above not to fire liftoff method.

AnyIdea ?

Was it helpful?

Solution

Well, he's got pretty good documentation on his site:

http://keith-wood.name/countdownRef.html

$(selector).countdown('destroy')

or

$(selector).countdown('pause')

both seem like good places to start.

OTHER TIPS

Instead of liftoff you can use a string variable and make it null on the click of button .

You may also read the documentation here .

Here is the code which you can use

var dateObj = new Date(2012, 8 - 1, 8);
$(selector).countdown({ 
    until: dateObj}); 
$("#button").click(function(){
dateObj = null;});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top