transitionend event

PHOTO EMBED

Sun Feb 26 2023 22:30:54 GMT+0000 (Coordinated Universal Time)

Saved by @davidmchale #intersection #observer

function removeTransition(e){
  console.log(e.propertyName)
  // can do a condition based on a property or add a property using setProperty
  //example
  
   this.style.setProperty("background-color", 'blue');
  
  // a a consition to
 	if(e.propertyName !== 'transform') return
  	this.classList.remove('playing');
 
}


const keys = [...document.querySelectorAll('.key')]; //loop over all items clicked
keys.forEach((key) => key.addEventListener('transitionend', removeTransition))
content_copyCOPY