// The slideshow should scale to the optimium size: no larger than 80% of screen width or height
// but also only as large as necessary for the included images (which are scaled to fit the screen ratio)
+ // When the resize function fires, the slideshow might not yet be fully ready so the heights
+ // can be zero or negative. This causes an ugly jump with the thumbnails and a content redraw
+ // so we make it invisible until it is ready (resize function runs more than once)
+ if (fluidbook.slideshow.$wrapper.height() <= 0) {
+ fluidbook.slideshow.$wrapper.css('opacity', 0);
+ } else {
+ fluidbook.slideshow.$wrapper.css('opacity', 1);
+ }
+
var horizontalPadding = fluidbook.slideshow.$slideshow.outerWidth() - fluidbook.slideshow.$slideshow.width();
- var verticalPadding = fluidbook.slideshow.$slideshow.outerHeight() - fluidbook.slideshow.$slideshow.height();
+ var verticalPadding = fluidbook.slideshow.$wrapper.outerHeight() - fluidbook.slideshow.$wrapper.height();
// var lcss = 'color:#fff;padding:0.5em;background:';
+ // console.log('%cWRAPPER: '+ fluidbook.slideshow.$wrapper.height() +' | ' + fluidbook.slideshow.$wrapper.outerHeight(), lcss+'dodgerblue');
// console.log('%cVPad: '+ verticalPadding + ' | HPad: '+ horizontalPadding, lcss+'green');
var headerHeight = m.find('.caption').outerHeight(); // Height of title section that also contains close button
if (optimizeHeight) {
fluidbook.slideshow.$thumbnails.hide();
thumbnailsHeight = 0;
- m.find('.caption, .back').addClass('small');
+ m.find('.caption, .back, .fb-slideshow-wrapper').addClass('small');
} else {
fluidbook.slideshow.$thumbnails.show();
- m.find('.caption, .back').removeClass('small');
+ m.find('.caption, .back, .fb-slideshow-wrapper').removeClass('small');
}
// Default on larger screens is for modal to cover 80% of area but only if image is large enough
var slideMaxHeight = h - headerHeight - thumbnailsHeight - verticalPadding; // Remaining height that main image + caption has to fit into
// console.log('%cslideMaxHeight: '+ slideMaxHeight +' %cheaderHeight: '+ headerHeight +' %cthumbnailsHeight: '+thumbnailsHeight, lcss+'teal', lcss+'blueviolet', lcss+'crimson');
-
- // console.log('%cMain slideshow height: '+ $('.fb-slideshow').height(), lcss+'chocolate');
+ // console.log('%cMain slideshow height: '+ $('.fb-slideshow').height(), lcss+'hotpink');
// Process each slide and calculate optimal height for image and slide container
fluidbook.slideshow.$slideshow.find('.fb-slideshow-slide').each(function () {
var $this = this;
this.slideshowID = '#' + id;
this.$slideshow = $(this.slideshowID);
+ this.$wrapper = this.$slideshow.parent();
this.thumbnailsID = this.slideshowID + '_thumbnails';
this.$thumbnails = $(this.thumbnailsID);
this.showThumbnails = this.$slideshow.attr('data-thumbnails') === '1';
});
// Height and width are set by fluidbook.menu resize function
- // ToDo: see if it's better setting these options as a data attribute from the PHP side? Then certain options like type / start could be set from PHP directly.
+ // Note: certain settings are set via the data-splide attribute, generated on the server-side
var slideshowSettings = {
type : 'loop', // slide | loop | fade
start : openIndex,
// Slideshow Module
+.fb-slideshow-wrapper {
+ padding-bottom: 60px;
+ transition: opacity 0.15s;
+
+ &.small {
+ padding-bottom: 30px;
+ }
+}
.fb-slideshow {
position: relative;
- padding: 0 60px 20px;
+ padding: 0 60px;
&.fb-slideshow-fullscreen {
padding-left: 0;
}
&-thumbnails {
- padding: 0 60px 20px;
+ padding: 20px 60px 0;
&.fb-slideshow-fullscreen {
padding-left: 10px;
display: none;
}
+ .fb-slideshow-slide:last-child {
+ margin-right: 0 !important;
+ }
+
img {
cursor: pointer;
}
}
}
-
-//--- Slick slider overrides
-
-/*
-.slick-slider * {
-
-}
-
-.slick-disabled {
- opacity: 0.25; // Applied to arrows when not clickable
-}
-
-.slick-arrow {
- display: inline-block;
- content: '';
- width: 25px;
- height: 25px;
- border-style: solid;
- border-color: #fff;
- border-width: 0 3px 3px 0;
- z-index: 2;
-
- &:before {
- display: none;
- }
-}
-
-.slick-next {
- transform: rotate(-45deg);
- right: 20px;
-}
-
-.slick-prev {
- transform: rotate(135deg);
- left: 20px;
-}
-*/