MadG Posted January 24, 2022 Share Posted January 24, 2022 Not sure whether I'm actually going to do this but just curious how y'all would handle it. In the above pen I'm basically moving through 4 quadrants of a square on scroll, and that all works fine. Trying to figure out how I could make it infinite, but it seems like setting body to scroll position 0 doesn't work, unless I'm typing something wrong. Any thoughts? See the Pen eYeOxZJ by kslaton (@kslaton) on CodePen Link to comment Share on other sites More sharing options...
Solution OSUblake Posted January 24, 2022 Solution Share Posted January 24, 2022 Hi MadG, Here's an example of looping by setting the scroll position. See the Pen XWeJXVz by GreenSock (@GreenSock) on CodePen 3 Link to comment Share on other sites More sharing options...
MadG Posted January 24, 2022 Author Share Posted January 24, 2022 @OSUblake perfect, exactly what I was looking for. Thanks! Link to comment Share on other sites More sharing options...
MadG Posted January 25, 2022 Author Share Posted January 25, 2022 Hey @OSUblake, I dropped your onLeave and onLeaveBack handlers into my pen, and it's looping backwards but not forwards. Any thoughts on why? Edit: nevermind, I see it works when embedded in this window, it just must be something weird with the codepen window in my browser. Disregard! 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