agsymonds Posted February 16, 2023 Share Posted February 16, 2023 Hi, I am trying to get an SVG to shrink and move to top left and then remain there so that it is the main page logo. The initial animation works, but when I scroll back down the page, the SVG jumps back to original Y position. I need it stay in the top left. Any help appreciated. TIA See the Pen poOJgzM by agsymonds (@agsymonds) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted February 16, 2023 Solution Share Posted February 16, 2023 That's because you're animating the exact same element that you're pinning. That's almost never a good idea because pinning is a complicated procedure that requires wrapping the element in a spacer <div> that's sized/positioned in a very particular way to match the original element, etc. so when you animate that element's properties, it messes up the pinning functionality. It's much better to just wrap that element in a container, pin that container and animate the child element: See the Pen eYLNJrg by GreenSock (@GreenSock) on CodePen 1 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