Updates docs js function
This commit is contained in:
parent
fcd44f4d44
commit
e2f4314c29
|
@ -1123,12 +1123,10 @@ element.style.setProperty('--animate-duration', '0.5s');
|
|||
// When the animation ends, we clean the classes and resolve the Promise
|
||||
function handleAnimationEnd() {
|
||||
node.classList.remove(`${prefix}animated`, animationName);
|
||||
node.removeEventListener('animationend', handleAnimationEnd);
|
||||
|
||||
resolve('Animation ended');
|
||||
}
|
||||
|
||||
node.addEventListener('animationend', handleAnimationEnd);
|
||||
node.addEventListener('animationend', handleAnimationEnd, {once: true});
|
||||
});
|
||||
</code></pre>
|
||||
<p>And use it like this:</p>
|
||||
|
|
|
@ -37,12 +37,12 @@ const animateCSS = (element, animation, prefix = 'animate__') =>
|
|||
node.classList.add(`${prefix}animated`, animationName);
|
||||
|
||||
// When the animation ends, we clean the classes and resolve the Promise
|
||||
handleAnimationEnd = () => {
|
||||
function handleAnimationEnd() {
|
||||
node.classList.remove(`${prefix}animated`, animationName);
|
||||
resolve('Animation ended');
|
||||
}
|
||||
|
||||
node.addEventListener('animationend', handleAnimationEnd, {once : true});
|
||||
node.addEventListener('animationend', handleAnimationEnd, {once: true});
|
||||
});
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue