From 3c7cbd964cf72f752cc6c0253d053ea1b2fb5adb Mon Sep 17 00:00:00 2001 From: Ryan Shrum Date: Fri, 11 Jan 2013 15:30:57 -0500 Subject: [PATCH] New transition: uncoverHorz Reveals prev/next slide in uncover fashion but respects direction of arrow click --- jquery.cycle.all.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/jquery.cycle.all.js b/jquery.cycle.all.js index 89d583e..54b822e 100644 --- a/jquery.cycle.all.js +++ b/jquery.cycle.all.js @@ -1483,6 +1483,21 @@ $.fn.cycle.transitions.uncover = function($cont, $slides, opts) { opts.cssBefore.left = 0; }; +// uncover horizontall - current slide moves off slide to left or right depending on arrow +$.fn.cycle.transitions.uncoverHorz = function ($cont, $slides, opts) { + var w = $cont.css('overflow', 'hidden').width(); + var h = $cont.height(); + opts.before.push(function (curr, next, opts, fwd) { + if (opts.rev) fwd = !fwd; + $.fn.cycle.commonReset(curr, next, opts, true, true, true); + opts.animOut.left = fwd ? -w : w; + }); + opts.animIn.left = 0; + opts.animIn.top = 0; + opts.cssBefore.top = 0; + opts.cssBefore.left = 0; +}; + // toss - move top slide and fade away $.fn.cycle.transitions.toss = function($cont, $slides, opts) { var w = $cont.css('overflow','visible').width();