Created
May 1, 2013 05:59
-
-
Save erikjung/5493963 to your computer and use it in GitHub Desktop.
Animation End Event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="foo"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setTimeout(function () { | |
| var foo = document.querySelector('.foo') | |
| foo.addEventListener('webkitAnimationEnd', function () { | |
| console.log('Animation End') | |
| foo.parentNode.removeChild(foo); | |
| }) | |
| foo.classList.add('removed') | |
| }, 3000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"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