Giter Club home page Giter Club logo

Comments (6)

maitre-hibou avatar maitre-hibou commented on July 21, 2024 1

Holy hell I forgot to remove this one :/

Thanks for the help and sorry for the loss of time ^^

Cheers !

from barba.

luruke avatar luruke commented on July 21, 2024

Hi @arnaud-xp !
Thanks for using Barba.js!

this.newContainer element is by default as visibility: hidden.
You can check the documentation for more information.

So, just changing your code to:

$(this.newContainer).css({
    opacity: 0,
    visibility: 'visible'
});

Should work :)

Feel free to close the ticket if the problem is solved

from barba.

maitre-hibou avatar maitre-hibou commented on July 21, 2024

Hi @luruke !

I just made the change but the problem stays the same :/

Any other clue ?

Cheers !

from barba.

luruke avatar luruke commented on July 21, 2024

Are you sure?
I just tested the Transition and it works fine.

Just to be clear, the final code should be something like:

var AwesomeTransition = Barba.BaseTransition.extend({
    start: function () {
        Promise
            .all([
                this.newContainerLoading,
                this.fadeOut()
            ])
            .then(this.fadeIn.bind(this));
    },
    fadeIn: function () {
        var _this = this;

        $(this.oldContainer).hide();

        $(this.newContainer).css({
            opacity: 0,
            visibility: 'visible'
        });
        $(this.newContainer).animate({opacity: 1}, 750, function () {
            _this.done();
        });
    },
    fadeOut: function () {
        return $(this.oldContainer).animate({opacity: 0}, 750).promise();
    }
});

If the problem persist, try to check if you may have some CSS rule that interfere, or try to post a working example somewhere.

Cheers

from barba.

maitre-hibou avatar maitre-hibou commented on July 21, 2024

Hey again !

I double checked your code, we have the same thing. I didn't found any css rules interfering but if you want to have a look, check here => http://350bf6a3.ngrok.io/

Click on menu and then switch pages by clicking on the logo or on the link "A propos"

Cheers !

from barba.

luruke avatar luruke commented on July 21, 2024

Hey again

You have a nice CSS rule:

* {
    transition: all ease 0.3s;
}

Not only this is a performance killer, but also means that every time jQuery update the opacity tween there is a css transition on it.

Removing solve it.

Let me know if it works

from barba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.