How do I reload script using barba transition


This Content is from Stack Overflow. Question asked by Jerem03

javascript is almost new for me and I wanted to use a transition with barba.js.

Unfortunately, I encountered a problem that seems common, once my transition is done, I have to reload the page for the additional scripts to work.

I’ve been looking for a long time and tried a lot of solutions, but with my level of javascript, I’m not even sure I’ve typed the code correctly.

I leave my Github project here, if someone is willing to explain to a noob how to write code correctly, I will be eternally grateful.

    const wipe = document.querySelector('.wipe-transition');
const allBandes = document.querySelectorAll('.bande');
const TLAnim = new TimelineMax();

function delay(n) {
    return new Promise((done) => {
        setTimeout(() => {
        }, n)


    sync: true,

    transitions: [
            async leave() {

                const done = this.async();

                    .to(allBandes, { height: '100%', stagger: 0.05 })

                //, {left: '0%', ease: "power2.out", duration: 0.5});

                await delay(1500);



            enter() {

                // TLAnim
                // .to(wipe, {left: '100%', ease:"", duration: 0.5})
                // .set(wipe, {left: '-100%'})

                    .to(allBandes, { height: '0%', stagger: 0.05 })



This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?