
        slide.addEventListener("webkitAnimationEnd", function(e){
          slide.removeEventListener("webkitAnimationEnd", this);
          resolve(slide);
        });
      });
    }

    function endAnimationOnOldSlide() {
      this.removeEventListener("webkitAnimationEnd", endAnimationOnOldSlide);
      this.classList.remove(activeClass);
      this.classList.remove(transition.forward.out);
      this.classList.remove(transition.backwards.out);
      this.classList.remove(outClass);
    }

    functio