<div class="right"></div>
</div>
</div>
+ <div id="elasticpages"></div>
</div>
</div>
</div>
--- /dev/null
+function FluidbookElasticSlide(fluidbook) {
+ this.fluidbook = fluidbook;
+ this.init();
+}
+
+FluidbookElasticSlide.prototype = {
+ init: function () {
+ let $this = this;
+ if (this.isEnabled()) {
+ this.initPages();
+ $(this.fluidbook).on('fluidbook.orientationchange', function () {
+ $this.checkActive();
+ });
+ this.checkActive();
+ $(this.fluidbook).on('fluidbook.resize', function (e, data) {
+ $this.resize(data);
+ });
+ }
+ },
+
+ initPages: function () {
+ let h = $('<div class="scrollholder"></div>');
+ for (let i = 1; i <= this.fluidbook.settings.pages; i++) {
+ let p = $(this.fluidbook.createPage(i, 'epage_'));
+ p.find('.background').append('<img src="data/thumbnails/p' + i + '.jpg" alt=""/>');
+ h.append(p);
+ }
+ $("#elasticpages").append(h);
+ },
+
+ checkActive: function () {
+ if (this.isActive()) {
+ this.switchToElastic();
+ } else {
+ this.switchToNormal();
+ }
+ },
+
+ switchToElastic: function () {
+ $('#elasticpages').show();
+ $("#pages").hide();
+ },
+
+ switchToNormal: function () {
+ $('#elasticpages').hide();
+ $("#pages").show();
+ },
+
+ isEnabled: function () {
+ return this.fluidbook.settings.slideTransitionsElastic == '1';
+ },
+ isActive: function () {
+ return true || (this.isEnabled() && this.fluidbook.displayOnePage);
+ },
+ preloadPage: function (page) {
+
+ },
+ resize: function (data) {
+
+ let w = parseFloat($("#fluidbook").css('width'));
+ let h = w / this.fluidbook.pageRatio;
+ $("#elasticpages .scrollholder").css('height', h * this.fluidbook.settings.pages);
+ $("#elasticpages .page").css({height: h});
+ },
+
+};
\ No newline at end of file
}
this.initSettings(settings);
+ this.pageRatio = this.settings.width / this.settings.height;
this.secure = new FluidbookSecure(this);
var $this = this;
this.cache = new FluidbookCache(this);
this.service = new FluidbookService(this, this.settings.id);
this.loader = new FluidbookLoader(this);
+
if (!this.mobilefirst.enabled) {
this.slider = new FluidbookSlider(this);
}
this.interface = new FluidbookInterface(this);
this.resize = new FluidbookResize(this);
this.pagetransitions = new FluidbookPageTransition(this);
+ this.elasticslide = new FluidbookElasticSlide(this);
this.stats = window.stats;
this.stats.setup(this);
return;
}
$(doublePage).find('.' + position).remove();
- var page = '<div class="page ' + position + '" id="page_' + pageNr + '" data-page="' + pageNr + '"><div class="background" page="' + pageNr + '"></div><div class="ctlinks" data-blendmode="normal"></div><div class="texts" highlight=""></div><div class="clinks" data-blendmode="normal"></div><div class="shade"></div></div>';
- $(doublePage).append(page);
+ $(doublePage).append(this.createPage(pageNr, '#page_', position));
+ },
+
+ createPage: function (pageNr, idprexif, position) {
+ if (position === undefined) {
+ position = '';
+ }
+ return '<div class="page ' + position + '" id="' + idprexif + pageNr + '" data-page="' + pageNr + '"><div class="background" page="' + pageNr + '"></div><div class="ctlinks" data-blendmode="normal"></div><div class="texts" highlight=""></div><div class="clinks" data-blendmode="normal"></div><div class="shade"></div></div>';
},
hidePage: function (position) {
this.fluidbook.zoom.setOrigin(ox, oy, true);
},
- elasticSlide: function () {
- return this.fluidbook.settings.slideTransitionsElastic == '1' && ['slide', 'portrait', 'slidefullwidth'].indexOf(this.fluidbook.pagetransitions.transitionType()) >= 0;
- }
};
\ No newline at end of file
--- /dev/null
+#elasticpages {
+ height: 100%;
+ width: 100%;
+ overflow: scroll;
+
+ .scrollholder {
+ position: relative;
+ width: 100%;
+
+ .page {
+ display: block;
+ position: relative;
+ }
+ }
+}
\ No newline at end of file
@import "notes.less";
@import "cart.less";
@import "audioplayer.less";
+@import "elasticslide.less";
\ No newline at end of file