From 2df84d59fb6ce7a335404053b8122ade3617a5f9 Mon Sep 17 00:00:00 2001 From: Thimp Date: Mon, 21 Jul 2014 11:34:56 +0200 Subject: [PATCH] Fixed fx for manual progressive slideshows The Fx of my manual progressive slideshow wasn't working the way I expected. The fx started on the old slide (slide to left or fade-out) and then briefly the background was visible and then the fx started on the new slide. The slides weren't synchronized anymore. A small timeout fixed this issue. You can see the bug in the demo of the progressive loading manual slide: http://jquery.malsup.com/cycle2/demo/progressive.php#manual --- src/jquery.cycle2.progressive.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jquery.cycle2.progressive.js b/src/jquery.cycle2.progressive.js index 2eab77e..10b5ecb 100644 --- a/src/jquery.cycle2.progressive.js +++ b/src/jquery.cycle2.progressive.js @@ -94,7 +94,9 @@ $(document).on( 'cycle-pre-initialize', function( e, opts ) { var slide = slides[ 0 ]; slides = slides.slice( 1 ); opts.container.one('cycle-slide-added', function(e, opts ) { - nextFn.apply( opts.API ); + setTimeout(function () { + nextFn.apply( opts.API ); + },50); opts.container.removeClass('cycle-loading'); }); opts.container.addClass('cycle-loading'); @@ -115,7 +117,9 @@ $(document).on( 'cycle-pre-initialize', function( e, opts ) { slides = slides.slice( 0, index ); opts.container.one('cycle-slide-added', function(e, opts ) { opts.currSlide = 1; - opts.API.advanceSlide( -1 ); + setTimeout(function () { + opts.API.advanceSlide( -1 ); + },50); opts.container.removeClass('cycle-loading'); }); opts.container.addClass('cycle-loading');