This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The CSSKeyframesRule interface describes an object representing a complete set of keyframes for a CSS animation. It corresponds to the contains of a whole @keyframes at-rule. It implements the CSSRule interface with a type value of 7 (CSSRule.KEYFRAMES_RULE).
As a CSSRule, CSSKeyframesRule also implements the properties of these interfaces. It has two properties :
CSSKeyframesRule.nameanimation-name property.CSSKeyframesRule.cssRules Read only
CSSRuleList of the CSS rules in the media rule.As a CSSRule, CSSKeyframesRule also implements the methods of that interface. It has three specific methods:
CSSKeyframesRule.appendRule()DOMString containing a keyframe in the same format as an entry of a @keyframes at-rule. If it contains more than one keyframe rule, a DOMException with a SYNTAX_ERR is thrown.CSSKeyframesRule.deleteRule()DOMString resolving as a number between 0% and 100%.CSSKeyframesRule.findRule()DOMString containing an index of the keyframe to be returned, resolving to a percentage between 0% and 100%. If no such keyframe exists, findRule returns null.| Specification | Status | Comment |
|---|---|---|
| CSS Animations The definition of 'CSSKeyframesRule' in that specification. | Working Draft | Initial definition |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | Yes | Yes | 48
|
10 | 12
|
4 |
appendRule
|
Yes
|
? | 22
|
10
|
Yes
|
Yes
|
cssRules
|
? | ? | ? | ? | ? | ? |
deleteRule
|
? | ? | ? | ? | ? | ? |
findRule
|
? | ? | ? | ? | ? | ? |
name
|
? | ? | ? | ? | ? | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | Yes | Yes | Yes | 48
|
12
|
Yes | ? |
appendRule
|
Yes
|
Yes
|
? | 22
|
Yes
|
Yes
|
? |
cssRules
|
? | ? | ? | ? | ? | ? | ? |
deleteRule
|
? | ? | ? | ? | ? | ? | ? |
findRule
|
? | ? | ? | ? | ? | ? | ? |
name
|
? | ? | ? | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframesRule