3

I have a website and in my html code I have added barba.js, If I go to inner pages barba animations are working fine, but other javascript functions are not working.

So i added this barba script in html page,

$('document').ready(function(){
  //initIndexJs();
  var transEffect = Barba.BaseTransition.extend({
    start: function(){
      this.newContainerLoading.then(val => this.fadeInNewcontent($(this.newContainer)));
    },
    fadeInNewcontent: function(nc) {
      nc.hide();
        var _this = this;
          $(this.oldContainer).fadeOut(1000).promise().done(() => {
            nc.css('visibility','visible');
              nc.fadeIn(1000, function(){
                _this.done();
                })
              });
            },
          });
          Barba.Dispatcher.on('transitionCompleted', function(currentStatus, oldStatus, container) {
            initIndexJs();
            //callForPageLoad();
    });
    Barba.Pjax.getTransition = function() {
      return transEffect;
    }
    Barba.Pjax.start();
});

So can anyone please help me to solve this problem?

Esko
  • 4,109
  • 2
  • 22
  • 37
Sankar S
  • 59
  • 1
  • 8

0 Answers0