barba.js
Version:
Barba.js it's a small, flexible and dependency free library that helps you creating fluid and smooth transition between your website's pages.
23 lines (19 loc) • 567 B
JavaScript
var BaseTransition = require('./BaseTransition');
/**
* Basic Transition object, wait for the new Container to be ready,
* scroll top, and finish the transition (removing the old container and displaying the new one)
*
* @private
* @namespace Barba.HideShowTransition
* @augments Barba.BaseTransition
*/
var HideShowTransition = BaseTransition.extend({
start: function() {
this.newContainerLoading.then(this.finish.bind(this));
},
finish: function() {
document.body.scrollTop = 0;
this.done();
}
});
module.exports = HideShowTransition;