Back

Version 4

6/9/2024
export function flashBorder(element) {
element.style.borderRight = '1px solid transparent';
let isFlashing = true;

function flash() {
if (isFlashing) {
element.style.borderRight = element.style.borderRight === '1px solid #ecf0f1' ? '1px solid transparent' : '1px solid #ecf0f1';
setTimeout(flash, 500);
}
}

flash();

setTimeout(() => {
isFlashing = false;
element.style.borderRight = '1px solid #ecf0f1';
}, 3000);
}

Updated: June 10, 2024