Jump to content
Search Community

Is there a way to disable mobile resize for a specific animation?

wobwobwob test
Moderator Tag

Recommended Posts

The animation in my hero jumps when the address bar is hidden on mobile, I fixed this by setting "ignoreMobileResize" to true on the "ScrollTrigger.config".

But some animations further down the page (that become sticky) need to be recalculated when the address bar is changed. For now I set it back, on staging you can see the that the hero animation on mobile jumps: https://neverland.owow.dev/

Is there a way to disable the mobile resize for my hero animation only?

Ps: I already tried many options like InvalidateOnRefresh but without success.

 

Kind regards,

Tom

Link to comment
Share on other sites

No it's not related, the problem is that the animation resets when the address bar shows again.

Spend days figuring out how to fix this, I fixed it by not defining a trigger. Did not even know that was possible, do you have any clue what was the problem for me so I understand?

 

// Tale fade words
const letters = document.querySelectorAll('.section-hero .tale-fade span');

let taleFade = gsap.timeline({
    scrollTrigger: {
        // trigger: '.section-hero .sticky',
        start: '0',
        end: '+=60%',
        scrub: true,
    },
});

taleFade.to(letters, {
    opacity: 0,
    stagger: 0.1,
});
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...