JavaScript animation engine
fix remove example
Julian Garnier4b4275daf8c6
diff --git a/examples/remove-elements-from-animations.html b/examples/remove-elements-from-animations.htmlindex 159bb7f5..2f120a28 100644--- a/examples/remove-elements-from-animations.html+++ b/examples/remove-elements-from-animations.html@@ -18,6 +18,9 @@div {width: 1.5rem;height: 1.5rem;+ }++ div.disabled {background: #FFF;}@@ -34,36 +37,25 @@<script src="../anime.js"></script><script>- // var animation = anime({- // targets: 'div',- // translateX: function() { return anime.random(-6, 6) + 'rem'; },- // translateY: function() { return anime.random(-6, 6) + 'rem'; },- // scale: function() { return anime.random(10, 20) / 10; },- // rotate: function() { return anime.random(-360, 360); },- // delay: function() { return 400 + anime.random(0, 500); },- // duration: function() { return anime.random(1000, 2000); },- // direction: 'alternate',- // loop: true- // });-- var loop = anime({- duration: 100,- update: function(anim) {- // console.log(anim.progress);- }+ var animation = anime({+ targets: 'div',+ translateX: function() { return anime.random(-6, 6) + 'rem'; },+ translateY: function() { return anime.random(-6, 6) + 'rem'; },+ scale: function() { return anime.random(10, 20) / 10; },+ rotate: function() { return anime.random(-360, 360); },+ delay: function() { return 400 + anime.random(0, 500); },+ duration: function() { return anime.random(1000, 2000); },+ direction: 'alternate',+ loop: true});document.onmousemove = function(e) {if (e.target.matches('div')) {anime.remove(e.target);+ e.target.classList.add('disabled');}}- document.onclick = function(e) {- animation.restart();- console.log(anime.list);- }-</script></body></html>