Skip to content

armgit / anime

Public Imported from GitHub
0

JavaScript animation engine

Better pause management, fix flashes / flicker when overlapping animations #269 #257

Julian Garnier34c27304b948
diff --git a/anime.js b/anime.js
index 6a242dcf..0961700a 100644
--- a/anime.js
+++ b/anime.js
@@ -892,9 +892,10 @@
}
instance.pause = function() {
- const i = activeInstances.indexOf(instance);
- if (i > -1) activeInstances.splice(i, 1);
- instance.paused = true;
+ requestAnimationFrame(() => {
+ const i = activeInstances.indexOf(instance);
+ if (i > -1) activeInstances.splice(i, 1);
+ });
}
instance.play = function() {