Jump to content
GreenSock

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

Toggling classes on sticky header

Recommended Posts

I have made some amends to a demo I found of a sticky header. I was trying to add a class when the user is at the top of the browser in order to blend the header into a hero or something. Is what I have done the most efficient way to do this?

 

Also is there some way of delaying the show and hide classes to avoid the flash of red on scroll down?

See the Pen mdOqXbr by darren-ignition (@darren-ignition) on CodePen

Link to comment
Share on other sites

Hey D.Cus. Generally speaking it's best to avoid animating using class names as it's a lot easier logically to just animate properties directly. Can you please show an example website or video of what you're trying to accomplish? That would help us better understand how we can help you get there.

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