amis-rpc-design/node_modules/rc-util/es/Dom/support.js
2023-10-07 19:42:30 +08:00

24 lines
701 B
JavaScript

import canUseDOM from "./canUseDom";
var animationEndEventNames = {
WebkitAnimation: 'webkitAnimationEnd',
OAnimation: 'oAnimationEnd',
animation: 'animationend'
};
var transitionEventNames = {
WebkitTransition: 'webkitTransitionEnd',
OTransition: 'oTransitionEnd',
transition: 'transitionend'
};
function supportEnd(names) {
var el = document.createElement('div');
for (var name in names) {
if (names.hasOwnProperty(name) && el.style[name] !== undefined) {
return {
end: names[name]
};
}
}
return false;
}
export var animation = canUseDOM() && supportEnd(animationEndEventNames);
export var transition = canUseDOM() && supportEnd(transitionEventNames);