buster808 Posted May 13, 2021 Share Posted May 13, 2021 Hi, I have animation here https://xtracreative.co.uk/snow/ I tried putting on codepen but wouldn't work but will try again zzzzzzzz at mo. The snowboarder stops working on browser resize. I used ScrollTrigger.scrollerProxy() with native maybe this is the issue. How can i get round this. I have used two svgs and scrolltriggers for the animation. I couldn't get it too work using one SVG. Thanks See the Pen mdWVKYq by buster808 (@buster808) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted May 13, 2021 Solution Share Posted May 13, 2021 You weren't loading ScrollTrigger in that CodePen. Here's a fork with it loading: See the Pen eYvJbgG?editors=1010 by GreenSock (@GreenSock) on CodePen Are you saying that after you resize, scrolling doesn't animate anything? Or are you saying that you want you smooth scrolling not to be interrupted by the resizing? If it's the latter, it isn't something that's officially supported and I'm not sure how feasible it would be. But in my fork, scrolling seems to work fine even after resize, but maybe I'm missing something. 2 1 Link to comment Share on other sites More sharing options...
buster808 Posted May 13, 2021 Author Share Posted May 13, 2021 After browser resize the snowboarder position goes off screen and most of the time stops moving on scroll, everything else works fine, works again if I refresh the browser. Think I might add refresh browser on resize script and stop on ipad/mobile. Link to comment Share on other sites More sharing options...
GreenSock Posted May 14, 2021 Share Posted May 14, 2021 Ah, now I see what you mean. I had to look in Safari. Alright, I spent quite a bit of time hammering out a solution for you: See the Pen mdWPMwY?editors=0010 by GreenSock (@GreenSock) on CodePen Is that what you were looking for? 2 2 Link to comment Share on other sites More sharing options...
buster808 Posted May 14, 2021 Author Share Posted May 14, 2021 Thank you so much for putting in the time, works perfectly on resize now. LIKEx1000000 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