Changed transitionend listeners because of problems with firefox