A “transitionend” event that always fires, and once only
问题 I need a special transitionend -like event that fires once after all transitions are complete, or fires immediately if there are no transitions defined in the CSS. This what I've come up so far: (function($){ $.event.special.transitionsComplete = { setup: function(data, namespaces, eventHandle){ var queue = [], style = window.getComputedStyle(this, null), computedProps = style.getPropertyValue('transition-property').split(', '), computedDurations = style.getPropertyValue('transition-duration'