Cedec Posted October 17, 2023 Share Posted October 17, 2023 Hi, I'm trying to turn on and off automatic scrolling after reaching the div with the "works" class, unfortunately, but it starts immediately after running the code. Can anyone suggest how to edit the code? See the Pen VwqOqPd by cedec33 (@cedec33) on CodePen Link to comment Share on other sites More sharing options...
Trapti Posted October 17, 2023 Share Posted October 17, 2023 Hi, Here's a pen. I took out some code for simplicity. This is just autoScroll paused initially and when scroll trigger ".works" and user starts scroll down autoScroll plays. Hope it helps! See the Pen yLGdKXG?editors=0010 by tripti1410 (@tripti1410) on CodePen 1 Link to comment Share on other sites More sharing options...
Cedec Posted October 18, 2023 Author Share Posted October 18, 2023 @Trapti Thank you, it now starts beautifully. The hidden code is probably needed, because now I can't stop the automatic scrolling. However, I have one more question - the automatic scroll does not seem to work smoothly, but there is a "jump" of images from time to time. Is there any way to fix this? Link to comment Share on other sites More sharing options...
Rodrigo Posted October 18, 2023 Share Posted October 18, 2023 11 hours ago, Cedec said: the automatic scroll does not seem to work smoothly, but there is a "jump" of images from time to time. Is there any way to fix this? That most likely has to do with the amount of time of scroll animation. Longer animations can cause those jumps. One way is to add will-change: transform to the images and see if it improves that. Hopefully this helps. Happy Tweening! 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