function FluidbookSlideshow(fluidbook) {
this.fluidbook = fluidbook;
+ this.numSlides = 0;
}
FluidbookSlideshow.prototype = {
initSlideshow: function (id) {
- var $this=this;
+ var $this = this;
var $slideshow = $('#' + id);
var thumbnailsID = id + '_thumbnails';
var $thumbnails;
var showThumbnails = $slideshow.attr('data-thumbnails') === '1';
- if ($slideshow.length == 0) return false;
+ if ($slideshow.length == 0) {
+ return false;
+ }
+
+ this.numSlides = $slideshow.find('img').length;
+
+ console.log(this.numSlides);
+
+ showThumbnails = showThumbnails && numSlides > 1;
var openIndex = parseInt($slideshow.attr('data-open-index'));
if (isNaN(openIndex)) {
var slideshowParams = {
variableWidth: false,
- infinite: true,
+ infinite: this.numSlides > 1,
draggable: true
};
if (showThumbnails) {