Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ExpandTransition = Barba.BaseTransition.extend({
- start: function() {
- this.originalThumb = lastElementClicked;
- Promise
- .all([this.newContainerLoading, this.enlargeThumb()])
- .then(this.showNewPage.bind(this));
- },
- enlargeThumb: function() {
- var deferred = Barba.Utils.deferred();
- var thumbPosition = this.originalThumb.getBoundingClientRect();
- this.cloneThumb = this.originalThumb.cloneNode(true);
- this.cloneThumb.style.position = 'fixed';
- this.cloneThumb.style.top = thumbPosition.top+'px';
- this.oldContainer.appendChild(this.cloneThumb);
- TweenLite.to(this.cloneThumb, 0.3, {
- top: 0,
- height: window.innerHeight,
- onComplete: function() {
- deferred.resolve();
- }
- });
- return deferred.promise;
- },
- showNewPage: function() {
- this.newContainer.style.visibility = 'visible';
- this.newContainer.appendChild(this.cloneThumb);
- this.done();
- // this.cloneThumb.style.position = 'relative';
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement