Jump to content
Search Community

(ScrollTrigger + Scrub) Change text color in and out from the div

liow test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

Hi guys, this is my first time using GSAP. As mentioned in the title, I'm able to generate the effect without using scrub. However, I want the text color changes with scrub while entering the div and leaving the div. I tried using 2 triggers to do it but it failed. Anyone know how to make it works?

 

Kindly let me know what's the better way of writing GSAP so that I'm able to refactor it.

Thank you so much.

See the Pen abyOaZg by callmeliow (@callmeliow) on CodePen

Link to comment
Share on other sites

  • liow changed the title to (ScrollTrigger + Scrub) Change text color in and out from the div
  • 5 months later...

I’d like to try and do this functionality using vanilla.js only but have failed! 

 

I have created a codepen of where I’ve got to. The effect works perfectly on enter but I cant seem to get it to work when leaving and re-entering.

 

If anyone can help solve this, would be very appreciative. Thanks in advance.

 

See the Pen mdpPWEy by jame5 (@jame5) on CodePen

 

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