Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions js/jquery.liquid-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,14 +652,18 @@ if (typeof Object.create !== 'function') {

setNextPanel: function(direction) {
var self = this;

if (direction === self.nextPanel)
return;
self.prevPanel = self.nextPanel;

if (self.loaded) {
if (typeof direction === 'number') {
self.nextPanel = direction;
self.direction = (self.prevPanel > direction) ? 'left' : 'right';
} else {
// "left" = -1; "right" = 1;
self.direction = direction
self.nextPanel += (~~(direction === 'right') || -1);
// If not continuous, slide back at the last or first panel
if (!self.options.continuous)
Expand Down Expand Up @@ -833,8 +837,9 @@ if (typeof Object.create !== 'function') {

transitionOutAnimateCSS: function() {
var self = this;
$(self.panelClass).removeClass(self.options.animateIn + ' animated');
$(self.panelClass).eq(self.prevPanel).addClass('animated ' + self.options.animateOut);
$(self.panelClass).removeClass(self.options.animateInLeft + ' animated ' + self.options.animateInRight);
var classStr = 'animated ' + ((self.direction == 'right') ? self.options.animateOutLeft : self.options.animateOutRight);
$(self.panelClass).eq(self.prevPanel).addClass(classStr);
self.callback(self.transitionInAnimateCSS, undefined);
},

Expand All @@ -843,8 +848,9 @@ if (typeof Object.create !== 'function') {
if (self.options.autoHeight)
self.adjustHeight(false, self.getHeight());
self.transitionCSS(self.getTransitionMargin(), !self.loaded);
$(self.panelClass).removeClass(self.options.animateOut + ' animated');
$(self.panelClass).eq(self.nextPanel).addClass('animated ' + self.options.animateIn);
$(self.panelClass).removeClass(self.options.animateOutLeft + ' animated ' + self.options.animateOutRight);
var classStr = 'animated ' + ((self.direction == 'right') ? self.options.animateInRight : self.options.animateInLeft);
$(self.panelClass).eq(self.nextPanel).addClass(classStr);
self.callback(self.options.callback, undefined);
},

Expand Down Expand Up @@ -954,8 +960,10 @@ if (typeof Object.create !== 'function') {
slideEaseDuration: 1500,
slideEaseFunction: "easeInOutExpo",
slideEaseFunctionFallback: "easeInOutExpo",
animateIn: "bounceInRight",
animateOut: "bounceOutRight",
animateInLeft: "bounceInLeft",
animateInRight: "bounceInRight",
animateOutLeft: "bounceOutLeft",
animateOutRight: "bounceOutRight",
continuous: true,
fadeInDuration: 500,
fadeOutDuration: 500,
Expand Down Expand Up @@ -1020,4 +1028,4 @@ if (typeof Object.create !== 'function') {
swipeArgs: undefined
};

})(jQuery, window, document);
})(jQuery, window, document);