tigrr / circle-progress

Responsive, accessible, animated, stylable with CSS circular progress bar available as plain (vanilla) JS and jQuery plugin.
https://tigrr.github.io/circle-progress
MIT License
171 stars 44 forks source link

Method to replay the animation #17

Closed thanhquocuit closed 1 year ago

thanhquocuit commented 2 years ago

Hi there,

I saw you do replay the animation on the example page but didn't know how to do it. Could you please show me the function to call or methods to manually trigger the animation anytime I want?

Thank you.

NordinGit commented 2 years ago

I was looking for the same thing.

tigrr commented 2 years ago

The animation is played automatically every time value changes. To play the animation from value a to value b you would have to follow this steps:

  1. Set animation to 'none' (unless you want the circle progress to animate to a too);
  2. Set the value to a;
  3. Set animation back to whatever easing function you want;
  4. Set the value to b.

For more details on the example and landing pages, you can check the docs directory of this repo.

tigrr commented 1 year ago

@thanhquocuit , @NordinGit , if the description above is sufficient and you won't have additional questions, I will close this issue.