Skip to content

Instantly share code, notes, and snippets.

@hgl
Last active August 29, 2015 14:25
Show Gist options
  • Select an option

  • Save hgl/d5bd16a1be0a0b30afba to your computer and use it in GitHub Desktop.

Select an option

Save hgl/d5bd16a1be0a0b30afba to your computer and use it in GitHub Desktop.
elem1.style.transform = "translateX(0px)";
var fx = new SequenceEffect([
new KeyframeEffect(elem1, [{
"transform": "translateX(100px)"
}, {
"transform": "translateX(200px)"
}], {duration: 500, fill: "forwards"}),
new KeyframeEffect(elem2, [{
"transform": "translateX(100px)"
}, {
"transform": "translateX(200px)"
}], {duration: 500, fill: "forwards"}),
], {direction: "reverse"});
document.timeline.play(fx);
// while elem2 is playing, should elem1's translateX be 200px or 0px?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment