Samuele Posted February 7, 2022 Share Posted February 7, 2022 Hi there, I have an horizontal website and I cannot figured out why the scrollTween doesn't work if the window is resized. Apparently the "bug" happens once an anchor link (left menu) is clicked and then the window is resized. Does anyone else experience this problem? Just to explain better I managed to calculate of user's scroll position once the window is resized by adding a simple function, but even if it is removed it doesn't solve the problem: function resize() { windowWidth = window.innerWidth; scrollContainerWidth = scrollContainer.scrollWidth; } ScrollTrigger.addEventListener("refreshInit", resize); resize(); Thanks See the Pen oNoYRrP by samuele-kriedi (@samuele-kriedi) on CodePen Link to comment Share on other sites More sharing options...
akapowl Posted February 7, 2022 Share Posted February 7, 2022 It does appear to work as expected (if I am not overlooking something obvious) on resize with the current version 3.9.1 See the Pen NWwbZBj by akapowl (@akapowl) on CodePen However with the latest beta files of GSAP & ScrollTrigger (which you load in your codepen @Samuele) it does indeed appear to break things on resize every other time. Maybe that's something for @GreenSock or @OSUblake to have a look at. See the Pen ExbNqxJ by akapowl (@akapowl) on CodePen Link to comment Share on other sites More sharing options...
Samuele Posted February 7, 2022 Author Share Posted February 7, 2022 Thanks @akapowl, very appreciate! By installing an older version it works as supposed. 2 Link to comment Share on other sites More sharing options...
GreenSock Posted February 8, 2022 Share Posted February 8, 2022 On 2/7/2022 at 4:13 AM, akapowl said: However with the latest beta files of GSAP & ScrollTrigger (which you load in your codepen @Samuele) it does indeed appear to break things on resize every other time. Maybe that's something for @GreenSock or @OSUblake to have a look at. Thanks for pointing that out! It should be resolved now, but please let us know if you see any odd behavior. 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