Jump to content

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

Multiple ScrollTriggers for same element

Recommended Posts

I'm trying to change sticky header color based on whether it's over light section or dark. It seems to be working on down scroll and when scrolling up and down over individual sections, but once the page is scrolled all the way to the bottom the header doesn't animate when scrolling back up. What am I doing wrong?

See the Pen gOPOxRg by kf420 (@kf420) on CodePen

Link to post
Share on other sites

Hi @kf420, pretty cool way of using ScrollTrigger!


The only thing you have to change is the third toggleAction ... to play. Those toggle positions are


Enter from bottom  ... leave the top ... come back in from top ... scroll all the way back to before start


See the Pen ZEQEqjb by sgorneau (@sgorneau) on CodePen


Happy tweening!



  • Like 6
Link to post
Share on other sites

Thank you so much!

  • Like 1
Link to post
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.