Jump to content
Search Community

ScrollTrigger pinned animation issue on Firefox

MsieurAri

Go to solution Solved by MsieurAri,

Recommended Posts

Posted

Hello

 

i've an issue on Firefox with a scrollTriggered animation in my hero :
https://preprod.golfindianovember.com/

 

the animation works well on chrome and safari, but at the end of the animation on firefox all my contents disapears (i see in the inspector the css change, the fixed attribute disabled at the end of the animation, maybe it's the problem ?)

i tried to normalizeScroll but nothing change. Any ideas ?  

 

Thanks !

Posted

Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? 

 

Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependencies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

 

See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen.

that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

 

Using a framework/library like React, Vue, Next, etc.? 

CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import GSAP as shown in the Install Helper in our Learning Center : 

 

Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. 

 

Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

Posted

Ok, I can't reproduce the bug on Codepen. The issue may be in my global structure.
Thank you

Posted

Yeah, in that case you'll have to start removing parts of your code, like other packages/libraries and see when it works as expected, or the other way around, start with the barebones of it with GSAP, then add stuff until it breaks and you'll find the reason for the problem.

 

Good luck with your project 👍

  • Solution
Posted

Okay, I've reproduced the problem and found a solution:
I set an "overflow-x :clip;" on the hero to prevent horizontal scrolling due to elements that would overflow, and it's this property that causes the error in Firefox.
So I passed the property to the body and everything is back to normal.

 

See the Pen PwPvpVP by msieurari (@msieurari) on CodePen.

  • Thanks 1
Posted

That's great to hear @MsieurAri! 🙌

 

Thanks for sharing your findings and solution with the community, I'm sure this will be helpful for other users as well.

 

Happy Tweening!

  • Like 1

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...