动态更改@keyframes


 var cssRule;

  function getRule() {
      var rule;
      var ss = document.styleSheets;
      for (var i = 0; i < ss.length; ++i) {
          for (var x = 0; x < ss[i].cssRules.length; ++x) {
              rule = ss[i].cssRules[x];
              if (rule.name == "change" && rule.type == CSSRule.KEYFRAMES_RULE) {
                  cssRule = rule;
              }
          }
      }
  }
   getRule();//获取@keyframes  
   cssRule.appendRule("to{padding-top: 20%;}") //覆盖

你可能感兴趣的:(动态更改@keyframes)