Jump to content
GreenSock

Vinicius Eidy

Like toggleClass but with properties instead class

Go to solution Solved by OSUblake,

Recommended Posts

Hi guys, I'm using ScrollTriger and trying to add/remove properties, just like toggleClass do with classes but instead classes, I want to add/remove props, what special prop of scrollTriger can I use? I'm using styled-components.

Link to comment
Share on other sites

  • Solution

Welcome to the forums @Vinicius Eidy

 

You can use your ScrollTrigger's callbacks like onEnter, onLeave, onEnterBack, and onLeaveBack to custom whatever you want. It's very similar to this answer. @akapowl is changing the classList property of an element. Same basic concept.

 

 

 

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