core-elements
core-elements copied to clipboard
core-animation doesn't seem to respect the "Infinity" duration
A duration of, say, 2000 works fine. But "Infinity" does not.
https://github.com/dart-lang/core-elements/blob/master/lib/src/core-animation/core-animation.html#L135
Never mind! I had it wrong. What I wanted was iterations
, not duration
. If I set duration
to Infinity
that meant that the change (color change in my case) would take forever, i.e. never happen. What I wanted was:
HtmlElement t = e.target;
var animation = new CoreAnimation();
animation.duration = "500";
animation.iterations = "Infinity";
animation.keyframes = [
{'background-color': 'blue'},
{'background-color': 'white'}
];
animation.target = t;
animation.play();