Jump to content
Search Community

Change the background color while scrolling in ScrollTrigger

Xurshed test
Moderator Tag

Recommended Posts

Heya! 

The scrollTrigger docs are a good place to start. You'll be looking at something along these lines though...
 

gsap.to(".section", {
  scrollTrigger: ".section", // start the animation when ".section" enters the viewport (once)
  backgroundColor: 'red'
});

 

If you'd like any more help please create a minimal demo so we can see what you've tried.


p.s. - There's a bunch of scrollTrigger demos here that are pretty useful to dig through and learn from - https://greensock.com/st-demos/
 



 

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