]> _ Git - fluidbook-html5.git/commitdiff
wait #7088 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 18 Sep 2024 17:37:28 +0000 (19:37 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 18 Sep 2024 17:37:28 +0000 (19:37 +0200)
js/libs/fluidbook/slideshow/fluidbook.slideshow.dummy.js

index f539acf8c0a3969d89a0ee0ac9985dc06ded021a..a5804f6741aefc3e9248784ce10ecbfb826b59b5 100644 (file)
@@ -52,29 +52,33 @@ FluidbookDummySlideshow.prototype = {
         this.clear(s);
         var holder = $(s).find('.splide__list');
         var $this = this;
-        holder.find('.fb-slideshow-slide').removeClass('show');
-        holder.find('.fb-slideshow-slide:eq(0)').addClass('show')
-        $(s).data('intervalHandle', requestInterval(
-            function () {
-                if (!$(holder).is(':visible')) {
-                    return;
-                }
-                var current = holder.find('.fb-slideshow-slide.show').eq(0);
-                var next = $(current).nextAll('.fb-slideshow-slide:not(.show):eq(0)');
-                if ($(next).length === 0) {
-                    next = holder.find('.fb-slideshow-slide:eq(0)');
-                }
-                $(next).css({display: 'block', zIndex: 2});
 
-                $(s).data('timeoutHandle', requestTimeout(function () {
-                    $(next).addClass('show').one($this.fluidbook.support.getTransitionEndEvent(), function () {
-                        $(holder).find('.fb-slideshow-slide.show').not(next).removeClass('show').css('display', 'none');
-                        $(this).css({zIndex: '', display: ''});
-                    });
-                }, 200));
+        setTimeout(function () {
+            holder.find('.fb-slideshow-slide').removeClass('show');
+            holder.find('.fb-slideshow-slide:eq(0)').addClass('show');
+
+            $(s).data('intervalHandle', requestInterval(
+                function () {
+                    if (!$(holder).is(':visible')) {
+                        return;
+                    }
+                    var current = holder.find('.fb-slideshow-slide.show').eq(0);
+                    var next = $(current).nextAll('.fb-slideshow-slide:not(.show):eq(0)');
+                    if ($(next).length === 0) {
+                        next = holder.find('.fb-slideshow-slide:eq(0)');
+                    }
+                    $(next).css({display: 'block', zIndex: 2});
+
+                    $(s).data('timeoutHandle', requestTimeout(function () {
+                        $(next).addClass('show').one($this.fluidbook.support.getTransitionEndEvent(), function () {
+                            $(holder).find('.fb-slideshow-slide.show').not(next).removeClass('show').css('display', 'none');
+                            $(this).css({zIndex: '', display: ''});
+                        });
+                    }, 200));
 
-            }, parseFloat($this.fluidbook.settings.inlineSlideshowDuration) * 1000)
-        );
+                }, parseFloat($this.fluidbook.settings.inlineSlideshowDuration) * 1000)
+            );
+        }, (parseFloat($this.fluidbook.settings.inlineSlideshowDuration) - 2) * 1000);
     },
 
     resizeInline() {