Skip to content

Instantly share code, notes, and snippets.

@malsup
Created May 31, 2011 01:17
Show Gist options
  • Save malsup/999720 to your computer and use it in GitHub Desktop.
Save malsup/999720 to your computer and use it in GitHub Desktop.
turnHorz cycle plugin transition
;(function($) {
$.fn.cycle.transitions.turnHorz = function($cont, $slides, opts) {
opts.before.push(function(curr, next, opts, fwd) {
$.fn.cycle.commonReset(curr,next,opts,false,true);
if (fwd) {
opts.cssBefore.left = next.cycleW;
opts.animIn.width = next.cycleW;
}
else {
opts.animIn.width = next.cycleW;
opts.animOut.left = curr.cycleW;
}
});
opts.cssBefore.top = 0;
opts.cssBefore.width = 0;
opts.animIn.left = 0;
opts.animOut.width = 0;
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment