Created
January 28, 2015 11:48
-
-
Save klaemo/10bdd98cfa2646653d54 to your computer and use it in GitHub Desktop.
onTransitionEnd one-off function
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
var transitionend = require('transitionend-property') | |
module.exports = { | |
onTransitionEnd: function(el, fn) { | |
var self = this | |
function handler(event) { | |
fn.call(self, event) | |
el.removeEventListener(event.type, handler) | |
} | |
el.addEventListener(transitionend, handler, false) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment