Skip to content

Instantly share code, notes, and snippets.

@erikjung
Created May 1, 2013 05:59
Show Gist options
  • Select an option

  • Save erikjung/5493963 to your computer and use it in GitHub Desktop.

Select an option

Save erikjung/5493963 to your computer and use it in GitHub Desktop.
Animation End Event
/**
* Animation End Event
*/
@keyframes remove {
from {
scale(1, 1);
}
to {
scale(0, 0);
opacity: .2;
}
}
.removed {
animation-name: remove;
animation-duration: 360ms;
animation-fill-mode: both;
}
.foo {
background: pink;
border-radius: 1em;
width: 10em;
height: 10em;
}
<div class="foo"></div>
setTimeout(function () {
var foo = document.querySelector('.foo')
foo.addEventListener('webkitAnimationEnd', function () {
console.log('Animation End')
foo.parentNode.removeChild(foo);
})
foo.classList.add('removed')
}, 3000)
{"view":"split","fontsize":"80","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment