JavaScript动态创建@keyframes

代码

--------.-----------[0].insertRule(`@keyframes testKeyframes { 10%{ opacity: 1; } 100% { opacity: 0.8; }}`, 0);

参考文档

MDN:CSSStyleSheet: insertRule() method