-
Notifications
You must be signed in to change notification settings - Fork 311
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
How to delay start animation? #163
Comments
Hi, @aha74! I appreciate your words, thanks ;) To delay the animation you could: el.circleProgress({
// any options, but value is 0 at the beginning
value: 0
});
setTimeout(() => el.circleProgress('value', realValue), 2000); In addition, you could wait until your circle appears in browser's viewport - see #8. |
Thanks for the response. Sorry, but I'm a newb at this. Where would I put it in this code. <script>
var circle = $('#circle').circleProgress({
value: 0.71,
fill: {
gradient: ['#002856', '#67b2e8']
},
size: 150
});
circle.resizable()
.on('resizestop', function() {
circle.circleProgress();
});
circle.on('circle-animation-progress', function(e, p, v) {
var obj = $(this).data('circle-progress'),
ctx = obj.ctx,
s = obj.size,
sv = (100 * v).toFixed(),
fill = obj.arcFill;
ctx.save();
ctx.font = "bold " + s / 2.5 + "px sans-serif";
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillStyle = fill;
ctx.fillText(sv, s / 2, s / 2);
ctx.restore();
});
</script> Also, how would I add an "%" at the end of the numbers, yet make it smaller then the number? |
In you HTML, below the library inclusion. Or in one of your JS files.
Change
That would be pretty hard in this case. You can use another approach - render the text in HTML, not in canvas (just add some |
Thanks for all the help. My apologies, but what I mean is, where in my current script, would I put the timer delay script you provided. |
Here's a snippet for you. |
You are the man!!! Thank you! |
You're welcome ;) I'm closing this ticket. |
Hi! First off, great plugin! I was wondering if you can help me with delaying the animation. For example, I would like the animation to start one or two seconds after the page loads. Thanks in advance.
The text was updated successfully, but these errors were encountered: