22 lines
574 B
JavaScript
22 lines
574 B
JavaScript
/*
|
|
* @Author: ddmt
|
|
* @Date: 2024-9-29 20:50:12
|
|
* @LastEditTime: 2024-9-29 20:50:12
|
|
* @LastEditors: ddmt
|
|
* @Description: ddmt-index file
|
|
* @FilePath: /Tool/animate.js
|
|
*/
|
|
|
|
/**
|
|
* 动画函数
|
|
* @param {HTMLElement} event
|
|
* @param {string} classname
|
|
*/
|
|
export function animateStart(event, className, forceExecute) {
|
|
if (forceExecute) event.target.classList.remove(className); // 清洗动画
|
|
event.classList.add(className);
|
|
event.addEventListener('animationend', (event) => {
|
|
event.target.classList.remove(className); // 清洗动画
|
|
});
|
|
}
|