From fa46e297b7e8e2207ad778e8b52b281c62c3a0b3 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 18 Sep 2024 19:37:28 +0200 Subject: [PATCH] wait #7088 @0.5 --- .../slideshow/fluidbook.slideshow.dummy.js | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/js/libs/fluidbook/slideshow/fluidbook.slideshow.dummy.js b/js/libs/fluidbook/slideshow/fluidbook.slideshow.dummy.js index f539acf8..a5804f67 100644 --- a/js/libs/fluidbook/slideshow/fluidbook.slideshow.dummy.js +++ b/js/libs/fluidbook/slideshow/fluidbook.slideshow.dummy.js @@ -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() { -- 2.39.5