Skip to content

Commit

Permalink
ye
Browse files Browse the repository at this point in the history
  • Loading branch information
BulldogM authored May 20, 2024
1 parent aab6928 commit 035ef22
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,18 @@ function barSlide(elmnt, end) {
let pos = 0;
let inc = Math.round(end)/100;
clearInterval(id);
id = setInterval(frame, 5);
function frame() {
if (end==0) {
elmnt.style.width = "0%";
} else {
id = setInterval(frame, 5);
function frame() {
if (Math.round(pos) == Math.round(end)) {
clearInterval(id);
} else {
pos += inc;
elmnt.style.width = pos + "%";
}
}
}
}

Expand Down

0 comments on commit 035ef22

Please sign in to comment.