LeO_on Posted July 23, 2022 Share Posted July 23, 2022 Hello! Sorry for my english, i will use google translator. Found strange behavior on the official script example When I scroll down a bit and resize the screen, the current scroll and animation should return to their previous state. This works, but when I remove the optional section with class "gray" from the bottom, the scroll jumps to the top of the page when i resize from mobile to desktop and vice versa. Why? How do i get the scroll to be saved. Attached video in low resolution. I wanted to recreate timelines and sub-timelines for mobiles and desktops, but i dont like this jump to the top of the page. Therefore, now I make one instance of the trigger, and when the screen changes, I reset the timeline with clear() and progress(progress), but did not figure out how to create sub-timelines (with add(subtimeline)). Thanks! Bug ScrollTrigger.webm See the Pen GRoyWBd by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
LeO_on Posted July 23, 2022 Author Share Posted July 23, 2022 Although, logically, scroll should not revert, because timelines duration may be different? Then how to make a separate version of main timeline with sub-timelines for mobile and desktop and save scroll position? Link to comment Share on other sites More sharing options...
LeO_on Posted July 23, 2022 Author Share Posted July 23, 2022 I found an old example on the internet See the Pen d951058e0b04421dd0b0cc0ce2bbce25 by osublake (@osublake) on CodePen how to do that (different timelines on mobile and desktop)? how to make subtimelines to this main timeline? because after binding to the scrollTrigger main timeline, subtimelines behave incorrectly after resize, maybe i need to somehow reset them? Link to comment Share on other sites More sharing options...
Solution GreenSock Posted July 23, 2022 Solution Share Posted July 23, 2022 First of all, that original demo was broken because it was linking to the beta version of ScrollTrigger which had a bug (and is now fixed). You may need to clear your cache and reload. I didn't quite understand what you're asking - your last demo seemed to show well how you can grab the progress of a particular timeline, create a new one, and re-assign the progress to match where it was previously. If you're still having trouble, please provide a minimal demo with as little as possible, just enough to show the particular issue you're struggling with and we'd be happy to take a look. Link to comment Share on other sites More sharing options...
LeO_on Posted July 24, 2022 Author Share Posted July 24, 2022 13 hours ago, GreenSock said: First of all, that original demo was broken because it was linking to the beta version of ScrollTrigger which had a bug (and is now fixed). You may need to clear your cache and reload. I didn't quite understand what you're asking - your last demo seemed to show well how you can grab the progress of a particular timeline, create a new one, and re-assign the progress to match where it was previously. If you're still having trouble, please provide a minimal demo with as little as possible, just enough to show the particular issue you're struggling with and we'd be happy to take a look. I updated the cache and nothing has changed - it also throws me to the top of the page after page resize. About the last demo: I can add tweens to the main timeline, but I can’t create sub-timelines (via add(subtimeline)), do I need to reset their behavior somehow? ok, i'll make a demo, but later. Thanks! Link to comment Share on other sites More sharing options...
LeO_on Posted July 24, 2022 Author Share Posted July 24, 2022 14 hours ago, GreenSock said: First of all, that original demo was broken because it was linking to the beta version of ScrollTrigger which had a bug (and is now fixed). You may need to clear your cache and reload. I didn't quite understand what you're asking - your last demo seemed to show well how you can grab the progress of a particular timeline, create a new one, and re-assign the progress to match where it was previously. If you're still having trouble, please provide a minimal demo with as little as possible, just enough to show the particular issue you're struggling with and we'd be happy to take a look. although after updating the cache, my project started working, although I used the current version of ScrollTrigger, strange, thank you! 1 Link to comment Share on other sites More sharing options...
GreenSock Posted July 25, 2022 Share Posted July 25, 2022 @LeO_on are you saying that the beta version of ScrollTrigger does NOT work, but the last official release DOES? Are you sure? Can you please provide a very clear minimal demo? And again, it's essential that you clear your cache completely to ensure you're using BOTH the GSAP core beta and ScrollTrigger beta. 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