Faith Akakpo Posted June 10, 2024 Posted June 10, 2024 I tried to make a swipe in on hover effect for my button, I found out you can't directly manipulate pseudo elements in gasp and I found out about the variable way. When I hover over the link it slides in but when I hover out it does nothing; it just stays there, it does not reverse back to its original position. It worked for rotate, skew and scale but not for transform translateX. I also tried using left property, but it had the same exact results. My example: using variables with gsap (codepen.io) See the Pen KKLXwqW by faisy227 (@faisy227) on CodePen.
Solution Rodrigo Posted June 10, 2024 Solution Posted June 10, 2024 Hi, Just an issue with how you were using CSS variables and the fact that you are adding CSS transitions to it as well. Is a bad idea to add CSS transitions to the same properties GSAP is animating as Jack explains in this thread: Here is a fork of your demo: See the Pen bGyoddr by GreenSock (@GreenSock) on CodePen. Hopefully this helps. Happy Tweening!
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