dna75 Posted March 29, 2022 Share Posted March 29, 2022 I have a logo which rotates 360 degrees after loading the page. When the users scroll down, the logo also rotates. When I scroll down before the initial 360 rotation has finished and go back up I notice that the logo is skewed because the 'scroll-rotation' has already begun. Is it possible to rotate the logo back to zero when reaching the top? See the Pen mdpwWPR by dna75 (@dna75) on CodePen Link to comment Share on other sites More sharing options...
Solution PointC Posted March 29, 2022 Solution Share Posted March 29, 2022 Hi @dna75 Welcome to the forum. You're creating a bit of a conflict there with two tweens fighting for control of the same property. If it were me, I think I'd simply wrap the image in a div and rotate the image on load and the div on scroll. Maybe something like this. See the Pen 4d2fa7059db58c1500e9274f95256518 by PointC (@PointC) on CodePen Just FYI - there is no #wrap so nothing will pin and you have some large delays in there (1000 & 5000?) I'm not sure what those are supposed to be doing. Hopefully that approach helps. Happy tweening and welcome aboard. 3 Link to comment Share on other sites More sharing options...
dna75 Posted April 1, 2022 Author Share Posted April 1, 2022 First of all thanks for the warm welcome! As you might have noticed this was my first GSAP project (47 years old and just discovered GSAP... something with better late then never...) Your solution works fine! Thanks. I think I found a alternative method. I don't want to finish the initial rotation if the user scrolls down before it has finished! Thanks for helping pointing in the right direction. I will also check the mega delays. See the Pen YzYxrqx by dna75 (@dna75) on CodePen 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