return this.setCurrentPage('1');
}
this.currentPageURL = page;
+ var anchor = false;
+ if (args.length > 3) {
+ anchor = args[3];
+ }
if (page !== $this.currentPage) {
$($this).trigger('fluidbook.page.navigation', [page]);
if (page !== $this.currentPage) {
$this.pagetransitions.pageTransition(page);
$this.stats.track(0, page);
+ if (anchor) {
+ $this.scrollToAnchorAfterTransition(anchor);
+ }
+ } else {
+ if (anchor) {
+ $this.scrollToAnchor(anchor);
+ }
}
$this.zoom.resetZoom();
-
$this.splash.hide();
}, true);
} else if (args[1] === 'landing') {
return;
},
+ scrollToAnchor: function (anchor) {
+ if (!this.mobilefirst.enabled) {
+ return;
+ }
+ var id = $('[data-anchor="anchor"]').attr('id');
+ TweenMax.to($("#scroll"), 0.5, {scrollTo: {y: '#' + id, offsetY: $('header').outerHeight() + 10}});
+ },
+
+ scrollToAnchorAfterTransition: function (anchor) {
+ if (!this.mobilefirst.enabled) {
+ return;
+ }
+ var $this = this;
+ if (this.splash.isVisible()) {
+ $(this).one('fluidbook.splash.hide', function () {
+ $this.scrollToAnchor(anchor);
+ });
+ } else {
+ $(this).one('fluidbook.page.change.end', function () {
+ $this.scrollToAnchor(anchor);
+ });
+ }
+ },
+
silentChangePage: function (page, transition) {
if (page !== this.currentPage) {
if (transition !== true) {
},
animateContentLink: function (link) {
- var animations = link.data('animations');
+ var animations = $(link).data('animations');
var $this = this;
var defaults = ['ease', 'duration', 'delay'];
}
if (tweenmax) {
TweenMax.fromTo(linkElement, duration, from, to);
- console.log('TweenMax.fromTo', duration, from, to);
}
this.fluidbook.networkControl.pause((to.delay + duration + 0.5) * 1000);
},