wimbarelds / TimeCircles

jQuery plugin to show time since or time until a specific time
295 stars 149 forks source link

Change data-timer #52

Closed harmenzon closed 10 years ago

harmenzon commented 10 years ago

Hello. Thanks for this great plugin. I am trying to change the data-timer value with Javascript or by changing the value of an input. So making it a variable. Can you please advice me how to change the value of the data-timer this way? Thanks!

wimbarelds commented 10 years ago

Use .data('timer', value) instead, and call .restart() immediately after the change.

So:

$('#Timer').data('timer', 20).TimeCircles().Restart();
wimbarelds commented 10 years ago

Also, in the latest version (just released 5 minutes ago), I added the .addTime(5) function. Where the 5 would be the number of seconds you want to add to the countdown.

If you have more questions or problems, feel free to ask

harmenzon commented 10 years ago

Thanks! Works perfect!

HagayAvisar1976 commented 4 years ago

when I change the data-timer the UI is not updated, why is that? $(".stopWatch").TimeCircles({timer:, start:false, time: { Days: { show: false }, Hours: { show: false }, Minutes:{show:false}}}).rebuild();