获取css3动画关键帧

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;
}

你可能感兴趣的:(获取css3动画关键帧)