12 lines
297 B
JavaScript
12 lines
297 B
JavaScript
/**
|
|
* 动画函数
|
|
* @param {HTMLElement} event
|
|
* @param {string} classname
|
|
*/
|
|
export function animate(event, classname) {
|
|
event.classList.add(classname);
|
|
event.addEventListener('animationend', (event) => {
|
|
event.target.classList.remove(classname); // 清洗动画
|
|
});
|
|
}
|