Page 1 of 1

Set Countdown using Javascript

Posted: Thu Jan 17, 2019 12:25 pm
by Kathi90
Hello everybody,
It is possible to set countdown using JavaScript?
I have tried several ways to manipulate the countdown non of them worked.

Code: Select all

  ....
<div class="cell-4">
   <div id="countdown_methods" data-role="countdown"></div>
</div>
<button class="button" onclick="setCountDown();">Click Me!</button>
 ...
function setCountdown(val) {
   $('#countdown_methods').attr('data-minutes', "174")
   $('#countdown_methods').data('countdown').start()
}
 ...
results in: undefined

The background is I want to set the countdown using a time-picker. I do not know if it is possible at all to set the countdown like this, I would also be happy about alternatives.

--Kathi

Re: Set Countdown using Javascript

Posted: Thu Jan 17, 2019 2:52 pm
by olton
Currently, you can't setup countdown at runtime

Re: Set Countdown using Javascript

Posted: Thu Jan 17, 2019 3:03 pm
by Kathi90
Thanks, I thought so.

Re: Set Countdown using Javascript

Posted: Thu Jan 17, 2019 4:06 pm
by olton
But you can create countdown on the fly with javascript https://sandbox.org.ua/olton/code/6z3w4prwgP