获取css3动画关键帧_html/css_WEB-ITnose
程序员文章站
2022-05-01 23:13:20
...
var getKeyFrame = function(index, name){ var styleSheet = document.styleSheets[index], keyframesRule = []; [].slice.call(styleSheet.cssRules).forEach(function(item){ if (item.type == CSSRule.KEYFRAMES_RULE) { if(item.name == name){ keyframesRule.push( item ); } } }) return keyframesRule;}