Skip to content

Instantly share code, notes, and snippets.

@robtarr
Created July 11, 2016 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robtarr/d4aecbf7f22418c459843f9f92484e27 to your computer and use it in GitHub Desktop.
Save robtarr/d4aecbf7f22418c459843f9f92484e27 to your computer and use it in GitHub Desktop.
CSS Animation Events
element.addEventListener('transitionend', function(e) {
let prop = e.propertyName.match(/border-(.*)-color/);
if (prop[1]) {
console.log(`Border color for ${prop[1]} transitioned`);
}
});
element.addEventListener('transitionend', function(e) {
if (e.propertyName === 'border-top-left-radius') {
console.log(`border-radius transitioned`);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment