MCPcopy Create free account
hub / github.com/ElemeFE/element-react / animateElement

Method animateElement

libs/transition/index.js:93–113  ·  view source on GitHub ↗
(element, action, active, fn)

Source from the content-addressed store, hash-verified

91 /* css animation fix when animation applyied to .{action} instanceof .{action}-active */
92
93 animateElement(element, action, active, fn) {
94 element.classList.add(active);
95
96 const styles = getComputedStyle(element);
97 const duration = parseFloat(styles['animationDuration']) || parseFloat(styles['transitionDuration']);
98
99 element.classList.add(action);
100
101 if (duration === 0) {
102 const styles = getComputedStyle(element);
103 const duration = parseFloat(styles['animationDuration']) || parseFloat(styles['transitionDuration']);
104
105 clearTimeout(this.timeout);
106
107 this.timeout = setTimeout(() => {
108 fn();
109 }, duration * 1000)
110 }
111
112 element.classList.remove(action, active);
113 }
114
115 didEnter(e) {
116 const childDOM = ReactDOM.findDOMNode(this.el);

Callers

nothing calls this directly

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected