X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/4d0e6b0b3f32591d2c9c3c3af85b1ffc289cfa4d..ea300f6c03d47f6c17dd7721b8d6690489af79da:/catalogue/static/catalogue/js/carousel.js diff --git a/catalogue/static/catalogue/js/carousel.js b/catalogue/static/catalogue/js/carousel.js index b7e5021..b2484be 100755 --- a/catalogue/static/catalogue/js/carousel.js +++ b/catalogue/static/catalogue/js/carousel.js @@ -2,31 +2,26 @@ $(function() { -$.fn.cycle.transitions.rgrowY = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $.fn.cycle.commonReset(curr,next,opts,true,false,true); - opts.cssBefore.top = this.cycleH/2; - opts.animIn.top = 0; - opts.animIn.height = this.cycleH; - opts.animOut.top = this.cycleH/2; - opts.animOut.height = 0; - }); - opts.cssBefore.height = 0; - opts.cssBefore.left = 0; -}; - $("#catalogue-carousel-links").each(function() { - $(this).cycle({ - fx: 'rgrowY', - sync:false, - easeIn: 'easeInQuad', - easeOut: 'easeOutQuad', + $slides = $(this); + + $slides.cycle({ + fx: 'fade', speed: 1000, + timeout: 5000, pager: '#catalogue-carousel-switcher', - pagerAnchorBuilder: function(){}, + pagerAnchorBuilder: function() {}, }); + + $("#catalogue-carousel-switcher li").each(function(i, e) { + $("a", e).click(function(ev) { + ev.preventDefault(); + $slides.cycle(i); + }); + }); + }); }); -})($); +})(jQuery);