question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Single keyframes unsupported

See original GitHub issue

In the spec, we’re given the following example: elem.animate({ left: '100px' }, 3000); As written, this throws the following error: TypeError: Keyframe effect must be null or an array of keyframes.

So, I make it a single-element array: elem.animate([{ left: '100px' }], 3000); And I try to explicitly declare the offset elem.animate([{offset: 0}, { left: '100px', offset: 1}], 3000); Both return NotSupportedError: Failed to execute 'animate' on 'Element': Partial keyframes are not supported.

Not sure if this is a bug or just a document that needs an update, but given these limitations, how can I animate starting from a current position? For example, if I don’t know what the element’s ‘left’ property is, but I know I want it to end up at 100px.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dstoccommented, Dec 30, 2014

All of these examples depend on additive animation, (in the 0/1 keyframes where left is not specified it’s treated as adding 0 to the underlying value. The error messages as you note are not that great, but as noted in the README.md additive animation is still to be implemented.

For example, if I don’t know what the element’s ‘left’ property is, but I know I want it to end up at 100px.

For now you will need to create a keyframe by reading the computed style:

elem.animate([{left: getComputedStyle(elem).left}, {left: '100px'}], 3000);
0reactions
shanscommented, Apr 30, 2015

Additive animation feature tracking here: https://github.com/web-animations/web-animations-next/issues/325

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to execute 'animate' on 'Element': Partial keyframes are ...
it works but an error is displayed in the console like: "Failed to execute 'animate' on 'Element': Partial keyframes are not supported." enter ......
Read more >
CSS Animations Not Working? Try These Fixes - HubSpot Blog
Learn how to fix common CSS animation error and get your animations looking how you want them.
Read more >
Live streaming error messages - YouTube Help
The audio stream is encoded with an unsupported codec. Please set the audio codec for ... Your encoder is sending keyframes too often...
Read more >
Stepped Animation Keyframes - Unity Forum
Hello all. I'm trying to make an animation look like stop motion. For this, I need the keyframes to have stepped tangents.
Read more >
keyframes - Angular
Defines a set of animation styles, associating each style with an optional offset value. ... the provided offset values animate("5s", keyframes([ style({ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found