Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Countdown Circle #23

Closed
jasonkmccoy opened this issue Feb 23, 2014 · 8 comments
Closed

Countdown Circle #23

jasonkmccoy opened this issue Feb 23, 2014 · 8 comments

Comments

@jasonkmccoy
Copy link

I have set the countdown to 15 seconds but when the countdown starts, the color that shows the remaining time starts at about 3 o'clock. I want the color to decrease starting at 12 o'clock until the countdown hits 0. I hope this makes sense.
screen shot 2014-02-23 at 2 40 19 pm

Thanks, Jason

@wimbarelds
Copy link
Owner

Hey there, the option you're looking for is total_duration. Try:

$("#YourTimer").TimeCircles({ total_duration: 15});

@jasonkmccoy
Copy link
Author

Thanks :) Worked like a charm. Could you tell me if its possible to change the color so that when there are 15 seconds to 10 seconds, the color is green. When the time is between 10 seconds and 5 seconds, the color is yellow, when it gets to 5 seconds to 0, the color is red? Thanks a lot

@wimbarelds
Copy link
Owner

That would be something like:

var $timerDiv = $("#YourTimer");
$timerDiv.TimeCircles({ total_duration: 15, time: { Seconds: { color: "#00FF00" } }}).addListener(unit, value, total) {
    if(total == 10) $timerDiv.TimeCircles({ time: { Seconds: { color: "#FFFF00" } } });
    else if(total == 5) $timerDiv.TimeCircles({ time: { Seconds: { color: "#FF0000" } } });
});

(I haven't tested this code, but the code should look something like this).

@jasonkmccoy
Copy link
Author

Thanks for your help. That last bit of code doesn't work or I'm doing it wrong.

@wimbarelds
Copy link
Owner

Could you link it to me so I can have a look?

@jasonkmccoy
Copy link
Author

Ok, here's the link: http://hoppedupdesigns.com/countdownTimer/index.html

@wimbarelds
Copy link
Owner

var $timerDiv = $("#YourTimer");
$timerDiv.TimeCircles({ total_duration: 15, time: { Seconds: { color: "#00FF00" } }}).addListener(function(unit, value, total) {
    if(total == 10) $timerDiv.TimeCircles({ time: { Seconds: { color: "#FFFF00" } } });
    else if(total == 5) $timerDiv.TimeCircles({ time: { Seconds: { color: "#FF0000" } } });
});

Found an error, try this:

@jasonkmccoy
Copy link
Author

Yep, that fixed it. Works great now. Thanks for your help and time. I'll stop bugging you now :)

@Fatbat Fatbat mentioned this issue Mar 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants