简体   繁体   中英

barba.js Uncaught TypeError: Cannot read property 'Promise' of undefined

js

Uncaught TypeError: Cannot read property 'Promise' of undefined

this is the code

$('document').ready(function(){
    var pagetrans = Barba.BaseTransition.extend({
        start: function() {
            Promise.all([this.newContainerLoading, this.left()]).then(this.right.bind(this));
        },
        left: function() {
            var transon = $(".transition").animate({left: '0px'});
            return $(this.oldContainer).transon.Promise();
        },
        right: function(el) {
            var _this = this;
            var el = $(this.newContainer);
            $(this.oldContainer).hide();
            el.css({
                visibility : 'visible',
                opacity : 0
            });
            var transoff = $(".transition").animate({left: '100%'});
            el.transoff, 400, function() {
                _this.done();
            };
        }
    });
    Barba.Pjax.getTransition = function() {
        return pagetrans;
    };
    Barba.Pjax.start();
});

the transition not working fine just start slide left and doesn't back right

我没有检查它是否有效,但是我认为promise()是正确的名称,而不是Promise()

return $(this.oldContainer).transon.promise();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM