You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/_util/isCssAnimationSupported.js

25 lines
599 B

let animation;
7 years ago
function isCssAnimationSupported() {
7 years ago
if (animation !== undefined) {
return animation;
7 years ago
}
const domPrefixes = 'Webkit Moz O ms Khtml'.split(' ');
const elm = document.createElement('div');
7 years ago
if (elm.style.animationName !== undefined) {
animation = true;
7 years ago
}
if (animation !== undefined) {
for (let i = 0; i < domPrefixes.length; i++) {
if (elm.style[`${domPrefixes[i]}AnimationName`] !== undefined) {
animation = true;
break;
7 years ago
}
}
}
animation = animation || false;
return animation;
7 years ago
}
export default isCssAnimationSupported;