FluidbookDummySlideshow.prototype = {
clear: function () {
- $.each(this.intervals, function (k, v) {
- clearInterval(v);
- });
+ // console.log('clear');
+ // $.each(this.intervals, function (k, v) {
+ // clearInterval(v);
+ // });
},
initSlideshow: function (s) {
if ($(s).data('init') === true) {
return;
}
- var holder=$(s).find('.splide__list')
+
+ var holder = $(s).find('.splide__list');
var $this = this;
s.data('init', true);
// Move first to end
holder.append(holder.find('.fb-slideshow-slide:eq(0)'));
- this.intervals.push(setInterval(function () {
- 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)');
- }
+ this.intervals.push(
+ setInterval(
+ 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});
+
+ setTimeout(function () {
+ $(next).addClass('show').one($this.fluidbook.support.getTransitionEndEvent(), function () {
+ $(current).removeClass('show').css('display', 'none');
+ $(this).css({zIndex: ''});
+ });
+ }, 200);
- $(next).css({display: 'block', zIndex: 2});
+ }
+ , parseFloat(this.fluidbook.settings.inlineSlideshowDuration) * 1000)
+ );
- setTimeout(function () {
- $(next).addClass('show').one($this.fluidbook.support.getTransitionEndEvent(), function () {
- $(current).removeClass('show').css('display', 'none');
- $(this).css({zIndex: ''});
- });
- }, 200);
- }, parseFloat(this.fluidbook.settings.inlineSlideshowDuration) * 1000));
},
resizeInline() {
this.fluidbook = fluidbook;
this.instances = {};
-
var $this = this;
$.each(['popup', 'inline'], function (k, v) {
},
initPopupSlideshow: function (s) {
- var s = this.normalizeSlideshowElement(s);
+ s = this.normalizeSlideshowElement(s);
this.popupInstance.initSlideshow(s);
},
initInlineSlideshow: function (s) {
- var s = this.normalizeSlideshowElement(s);
+ s = this.normalizeSlideshowElement(s);
this.inlineInstance.initSlideshow(s);
},
initSlideshow: function (s, context) {
- var s = this.normalizeSlideshowElement(s);
+ s = this.normalizeSlideshowElement(s);
if (context === 'popup') {
this.initPopupSlideshow(s);