Skip to content

Commit

Permalink
update orbit slide animation to move both current and next/prev slide…
Browse files Browse the repository at this point in the history
…s at the same time
  • Loading branch information
Mark Hayes committed Sep 24, 2013
1 parent 4564561 commit 0177da7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/foundation/foundation.orbit.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,20 +327,23 @@
var margin = is_rtl ? 'marginRight' : 'marginLeft';
var animMargin = {};
animMargin[margin] = '0%';
var easing = (typeof jQuery === 'undefined') ? 'ease-in-out' : undefined;

this.next = function(current, next, callback) {
next.animate(animMargin, duration, 'linear', function() {
next.animate(animMargin, duration, easing, function() {
current.css(margin, '100%');
callback();
});
current.animate({marginLeft:'-100%'}, duration, easing);
};

this.prev = function(current, prev, callback) {
prev.css(margin, '-100%');
prev.animate(animMargin, duration, 'linear', function() {
prev.animate(animMargin, duration, easing, function() {
current.css(margin, '100%');
callback();
});
current.animate({marginLeft:'100%'}, duration, easing);
};
};

Expand Down

0 comments on commit 0177da7

Please sign in to comment.