@keyframes写js

var tt=document.styleSheets[0];//获取所有样式
tt.deleteRule(6);//清除之前写入的动画样式
console.log(tt);
tt.insertRule("@-webkit-keyframes mymove{0%{} 100%{transform:rotateZ(0deg);top:10%;left:30%;400px}}",6);//写入样式

原文地址:https://www.cnblogs.com/llllpzyy/p/9831374.html