From: Vincent Vanwaelscappel Date: Mon, 14 Oct 2019 13:26:01 +0000 (+0200) Subject: fix #3131 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=aa0c7a6d654a011f0d17053132e6cf60cbb8262a;p=fluidbook-html5.git fix #3131 @1.5 --- diff --git a/js/libs/fluidbook/fluidbook.slideshow.js b/js/libs/fluidbook/fluidbook.slideshow.js index 831e12b8..98275837 100644 --- a/js/libs/fluidbook/fluidbook.slideshow.js +++ b/js/libs/fluidbook/fluidbook.slideshow.js @@ -11,6 +11,12 @@ FluidbookSlideshow.prototype = { if ($slideshow.length == 0) return false; + var openIndex = parseInt($slideshow.attr('data-open-index')); + if (isNaN(openIndex)) { + openIndex = 1; + } + openIndex--; + // Dynamically add thumbnails from full sized images // Images have to load anyway so we can reuse full images for thumbnails @@ -33,7 +39,10 @@ FluidbookSlideshow.prototype = { slideshowParams.asNasFor = '#' + thumbnailsID; // Synced with thumbnails slider } // Main image slider - $slideshow.slick(slideshowParams); + var mainSlideshow = $slideshow.slick(slideshowParams); + if (openIndex > 0) { + $slideshow.slick('slickGoTo', openIndex, true); + } if (showThumbnails) { // Thumbnails slider