Last Updated: February 25, 2016
·
652
· cbabos

TransitionEnd event

Hi folks,

today I've figured out how can we check, that a transition is ended on a certain element with JS.
I'm using jQuery in this example, however if you're using pure JS you can use a simple addEventListener() call on the element.

$("someSelector").on("transitionend", function () {
    /** For IE and Firefox */
    doFancyStuffz();
}).on("oTransitionEnd", function () {
    /** For Opera */
    doFancyStuffz();
}).on("webkitTransitionEnd", function () {
    /** For Webkit */
    doFancyStuffz();
});

I hope you find it useful :)