the icons are currently being faded out at the same time, however what i would like to do is put a delay between each icon within the for loop. How can i do this?
Hey Paul thank you so much for your response! Unfortunately for some reasons im unable to get the animation working.
Javascript code:
var delay = 0;
function closeHorizontalWindow()
{
const reasons = ['Ready', 'NotReady', 'Break', 'Email', 'Lunch', 'Break', 'Meeting', 'Chat']
for (let i = 0; i < reasons.length; i++) {
document.getElementById(reasons[i]).style.animation = "reasonsfadeout 1s ease " + delay + "s forwards";
delay++;
}
setTimeout(closeReasonStateLayout, 700); // once the icons have faded this function will be triggered
}
This is my current code, i want to activate the fade animation when any of the icons above have been clicked. I’ve attempted to add the delay variable but nothing seems to happen. Do you know why this might be?
The icons do fade out if i remove the delay variable but when this is included, nothing occurs.