CSSKeyframeRule: Eigenschaft style
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.
Die schreibgeschützte CSSKeyframeRule.style
-Eigenschaft ist die CSSStyleDeclaration
-Schnittstelle für den Deklarationsblock der CSSKeyframeRule
.
Wert
Ein CSSStyleDeclaration
-Objekt mit den folgenden Eigenschaften:
- computed flag
-
Nicht gesetzt.
- declarations
-
Die in der Regel angegebenen Deklarationen, in der Reihenfolge, in der sie spezifiziert wurden, wobei Kurzschreibweisen auf Langformen erweitert werden.
- parent CSS rule
-
Das Kontextobjekt, welches ein Alias für this ist.
- owner node
-
Null.
Beispiele
Das CSS enthält eine @keyframes
-At-Regel. Dies wird die erste CSSRule
sein, die von document.styleSheets[0].cssRules
zurückgegeben wird.
myRules[0]
gibt ein CSSKeyframesRule
-Objekt zurück, das einzelne CSSKeyFrameRule
-Objekte für jedes Keyframe enthält.
@keyframes slide-in {
from {
transform: translateX(0%);
}
to {
transform: translateX(100%);
}
}
let myRules = document.styleSheets[0].cssRules;
let keyframes = myRules[0]; // a CSSKeyframesRule
console.log(keyframes[0].style); // a CSSStyleDeclaration
Spezifikationen
Specification |
---|
CSS Animations Level 1 # dom-csskeyframerule-style |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
style |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support