If an element has more than one of its css properties changed and they have differing transition durations, is there a way to detect the completion of the last/longest running transition.
Example:
<style>
.box {
width: 100px;
height: 100px;
transition: width 0.5s, height 6s;
}
.animate {
width: 400px;
height: 400px;
}
</style>
<div class="box"></div>
<script>
// I want to run some code after both the width and height transitions
// are complete
// Listening for transitionend events will fire on every transition
// that ends. So in this case, both width and height. Assume I don't
// know how many properties are being transitioned.
$('.box').on('transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd', function(ev) {
// ...
});
$('.box').addClass('animate');
</script>