code: function whichTransitionEvent() {
      let t,
          el = document.createElement("fakeelement");
  
      const transitions = {
          transition: "transitionend",
          OTransition: "oTransitionEnd",
          MozTransition: "transitionend",
          WebkitTransition: "webkitTransitionEnd"
      };
  
      for (t in transitions) {
          if (el.style[t] !== undefined) {
              return transitions[t];
          }
      }
  }
docs: Determine transition events