kimmobrunfeldt / kimmobrunfeldt/progressbar.js

How to reset a progress bar to its default position?

Open
#269 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.9k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

Hi, I am using this library to put a timer on a web page, and I want the timer to run multiple times in a row. Is there a way to reset a timer back to its default position? I tried using something along the lines of this:
```function reset(cb) {
bar.animate(1, function() {
bar.animate(0);
});
}
```
But it resets the timer by reversing it, and doing the count in reverse (so counting from 0 back to 10). Surely there is a line of code that I am missing that just resets the timer back to how it was when the webpage was loaded. Or a way of running the code above instantly, with no time delay.

Contributor guide

Open the contributing guide

Research direction

Start at the bar.animate entry point used in the report and inspect how animation state and completion callbacks are handled. Determine whether the library already exposes a reset operation or whether the requested instant reset needs a defined API and tests for repeated timer runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.