Share Posted February 2 Hi First of all, thanks to the developers of this plugin. It is simply awesome. I have this setup using GSAP Timelines and ScrollTrigger where I have attached an animation with a scrollTrigger. I would like to give the user's two options to play the animation. 1. Via Scroll : I have added scrub to true to link the animation with the scrollbar position 2. Autoplay: I have given a button on the top to autoplay the animation. On clicking the autoplay button, I am disabling the scrollTrigger and playing the animation. When the timeline is complete, I am enabling the scrolltrigger again and pausing the timeline. Functionality wise on autoplay, I would like to stop the animation at the end and enable user to scroll the animation backwards. For this, in thescrollTrigger.enable() function call, I am passing the value of reset parameter as false based on the documentation. But as you can see in the codepen example, the animation resets back to the first frame. I read in this forum to use scroll() method. I tried that also, but that is causing a flicker on web devices and on mobile devices, it goes back to the first frame and scrolls to the last frame very fast. Please uncomment Line No 31 in the codepen to see that effect. Could you guys please help to achieve this effect!! See the Pen PoBybWj by rohit-uf (@rohit-uf) on CodePen Link to comment Share on other sites More sharing options...
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 account
Already have an account? Sign in here.Sign In Now