CodeBoi Posted October 15, 2020 Share Posted October 15, 2020 i am trying to activate an animation that will rotate the tire svg but id like to do it with scroll trigger basiclly when scrolling down i wanna activate a class or animation and when scrolling back up i wanna do the same but with different class or animation See the Pen eYzJxWv by ahmed-inc (@ahmed-inc) on CodePen Link to comment Share on other sites More sharing options...
CodeBoi Posted October 15, 2020 Author Share Posted October 15, 2020 Simplified: basiclly i want to activate the class "active" when i scroll down but currently that doesnt seem to work Link to comment Share on other sites More sharing options...
ZachSaucier Posted October 15, 2020 Share Posted October 15, 2020 Hey CodeBoi and welcome to the GreenSock forums. Why not use ScrollTrigger's toggleClass? See the Pen ZEOQPJj?editors=0010 by GreenSock (@GreenSock) on CodePen But the real question is why are you using CSS animations at all? I'd just do all the animations with GSAP. You'll gain a lot finer control over your animations. 2 Link to comment Share on other sites More sharing options...
CodeBoi Posted October 15, 2020 Author Share Posted October 15, 2020 30 minutes ago, ZachSaucier said: Hey CodeBoi and welcome to the GreenSock forums. Why not use ScrollTrigger's toggleClass? But the real question is why are you using CSS animations at all? I'd just do all the animations with GSAP. You'll gain a lot finer control over your animations. dude i dont know how to thank you , you are an absolute life-saver thx so much oh i forgot that gsap could even rotate that damm im so dumb Link to comment Share on other sites More sharing options...
ZachSaucier Posted October 15, 2020 Share Posted October 15, 2020 Anything that CSS can set or animate, GSAP can also and more Link to comment Share on other sites More sharing options...
CodeBoi Posted October 15, 2020 Author Share Posted October 15, 2020 2 minutes ago, ZachSaucier said: Anything that CSS can set or animate, GSAP can also and more oh wow i just found out tween and some more stuff thx ill try and convert the animation into to gsap Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now