Replace setTimeout for the native transitionend event to emit the 'end' event 

Using setTimeout can sometime trigger the end event when the transition is still on going (e.g., the browser paused the transition because the window didn't had focus). Using the _transitionend_ event fixes this problem.

[The browser compatibility of _transitionend_ event](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_transitions#Browser_compatibility)