Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

scrolltrigger changes the background of all elements to the background of the first occuring

Recommended Posts

Hey, I'm new to gsap and so I tried to do the tutorials here on the website, I'm stuck at that


Preview (from GSAP):

See the Pen KKpLdWW by GreenSock (@GreenSock) on CodePen


so I understand what it is doing but I don't understand why it is changing the bg-color from every element. Help is appreciated!


BG Paul


Preview (mine):

See the Pen jOzGKjv by libertey (@libertey) on CodePen

Link to comment
Share on other sites

Heya, Welcome!


I'm not really understanding though I'm afraid. GSAP isn't changing the background colour. That's set in CSS.

Link to comment
Share on other sites

The panel-backgrounds are defined in CSS in the example. Why no CSS is shown in that CodePen I don't know!


Link to comment
Share on other sites

Those examples largely use an external css file. This is great for maintaining consistency across the examples as well as making "global" updates to all the demos. However, it's not so good for people who want to look at the css.


If you go into the css section of the pen settings you will see where the css is coming from





that external css file is pulled from here


See the Pen 7ba936b34824fefdccfe2c6d9f0b740b by GreenSock (@GreenSock) on CodePen







  • Like 3
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.