Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. var ExpandTransition = Barba.BaseTransition.extend({
  2. start: function() {
  3. this.originalThumb = lastElementClicked;
  4.  
  5. Promise
  6. .all([this.newContainerLoading, this.enlargeThumb()])
  7. .then(this.showNewPage.bind(this));
  8. },
  9.  
  10. enlargeThumb: function() {
  11. var deferred = Barba.Utils.deferred();
  12. var thumbPosition = this.originalThumb.getBoundingClientRect();
  13.  
  14. this.cloneThumb = this.originalThumb.cloneNode(true);
  15. this.cloneThumb.style.position = 'fixed';
  16. this.cloneThumb.style.top = thumbPosition.top+'px';
  17. this.oldContainer.appendChild(this.cloneThumb);
  18.  
  19.  
  20. TweenLite.to(this.cloneThumb, 0.3, {
  21. top: 0,
  22. height: window.innerHeight,
  23. onComplete: function() {
  24. deferred.resolve();
  25. }
  26. });
  27.  
  28. return deferred.promise;
  29. },
  30.  
  31. showNewPage: function() {
  32. this.newContainer.style.visibility = 'visible';
  33. this.newContainer.appendChild(this.cloneThumb);
  34. this.done();
  35. // this.cloneThumb.style.position = 'relative';
  36. }
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement