mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-11-30 02:57:50 +08:00
25 lines
599 B
JavaScript
25 lines
599 B
JavaScript
let animation;
|
|
|
|
function isCssAnimationSupported() {
|
|
if (animation !== undefined) {
|
|
return animation;
|
|
}
|
|
const domPrefixes = 'Webkit Moz O ms Khtml'.split(' ');
|
|
const elm = document.createElement('div');
|
|
if (elm.style.animationName !== undefined) {
|
|
animation = true;
|
|
}
|
|
if (animation !== undefined) {
|
|
for (let i = 0; i < domPrefixes.length; i++) {
|
|
if (elm.style[`${domPrefixes[i]}AnimationName`] !== undefined) {
|
|
animation = true;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
animation = animation || false;
|
|
return animation;
|
|
}
|
|
|
|
export default isCssAnimationSupported;
|