Single keyframes unsupported
See original GitHub issueIn 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:
- Created 9 years ago
- Comments:9 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

All of these examples depend on additive animation, (in the 0/1 keyframes where
leftis not specified it’s treated as adding0to 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 now you will need to create a keyframe by reading the computed style:
Additive animation feature tracking here: https://github.com/web-animations/web-animations-next/issues/325