Permalink
Browse files

Add vertical push animation

  • Loading branch information...
1 parent bc93db0 commit 9a761b312f3d74108bcccdd8dcfd6c75d636f2df Matt committed Aug 23, 2011
Showing with 24 additions and 2 deletions.
  1. +24 −2 jquery.orbit-1.3.0.js
View
@@ -12,7 +12,7 @@
var ORBIT = {
defaults: {
- animation: 'horizontal-push', // fade, horizontal-slide, vertical-slide, horizontal-push
+ animation: 'horizontal-push', // fade, horizontal-slide, vertical-slide, horizontal-push, vertical-push
animationSpeed: 600, // how fast animtions are
timer: true, // true or false to have the timer
advanceSpeed: 4000, // if timer is enabled, time between transitions
@@ -437,7 +437,7 @@
}
}
- //push-over
+ //horizontal-push
if (this.options.animation == "horizontal-push") {
if (slideDirection == "next") {
this.$slides
@@ -459,6 +459,28 @@
}
}
+ //vertical-push
+ if (this.options.animation == "vertical-push") {
+ if (slideDirection == "next") {
+ this.$slides
+ .eq(this.activeSlide)
+ .css({top: -this.orbitHeight, "z-index" : 3})
+ .animate({top : 0}, this.options.animationSpeed, this.resetAndUnlock);
+ this.$slides
+ .eq(this.prevActiveSlide)
+ .animate({top : this.orbitHeight}, this.options.animationSpeed);
+ }
+ if (slideDirection == "prev") {
+ this.$slides
+ .eq(this.activeSlide)
+ .css({top: this.orbitHeight, "z-index" : 3})
+ .animate({top : 0}, this.options.animationSpeed, this.resetAndUnlock);
+ this.$slides
+ .eq(this.prevActiveSlide)
+ .animate({top : -this.orbitHeight}, this.options.animationSpeed);
+ }
+ }
+
this.setCaption();
}
}

0 comments on commit 9a761b3

Please sign in to comment.