Skip to content

armgit / anime

Public Imported from GitHub
0

JavaScript animation engine

Fix loop counts on reversed delay

Julian Garnier435296ffa5fb
diff --git a/anime.js b/anime.js
index 526ed897..bcc9c3c4 100644
--- a/anime.js
+++ b/anime.js
@@ -723,7 +723,7 @@
instance.progress = (insTime / insDuration) * 100;
if (insTime <= insDelay && insCurrentTime !== 0) {
setAnimationsProgress(0);
- if (insReversed) countIteration();
+ if (insReversed && insTime <= 0) countIteration();
}
if (insTime > insDelay && insTime < insDuration) {
setAnimationsProgress(insTime);
diff --git a/documentation/examples/direction-testing.html b/documentation/examples/direction-testing.html
index f58c5f56..b46307b9 100644
--- a/documentation/examples/direction-testing.html
+++ b/documentation/examples/direction-testing.html
@@ -64,6 +64,7 @@
params.targets = testZoneEl.querySelectorAll('div');
params.translateX = '26vw';
+ params.delay = 1000;
params.begin = function() { testEl.classList.add('color-01') };
params.update = function(a) { logEl.value = a.progress + '%' };
params.complete = function() { testEl.classList.add('color-04') };