Share Posted May 14, 2022 Hello.I'm going to put in a function that stops while scrolling.For a moment, I'm going to get the top of the image and the top of the screen exactly right.Should we use the pause() function of timeline?Or can it be solved with the function of scrolltrigger? See the Pen MWQbmwx by goodcontext (@goodcontext) on CodePen Link to comment Share on other sites More sharing options...
Share Posted May 14, 2022 I read your question a few times but I'm still very confused about what you're asking. You want to pause the animation (but allow scrolling)? Or you want to pause scrolling so that even if the user is trying to drag the scrollbar (or spin their mouse wheel), it won't budge? 1 Link to comment Share on other sites More sharing options...
Author Share Posted May 14, 2022 It's the latter.When the user scrolls down, even if they keep scrolling, they want it to stop at a certain point, just a little bit for a second.Thank you. Link to comment Share on other sites More sharing options...
Solution Solution Share Posted May 14, 2022 I'm still not sure because your demo has multiple scrollbars. It sounds like maybe you want to do "pinning"? That doesn't actually stop the scrollbar from moving - it simply pins the element for a certain scroll distance. You can read in the docs about the "pin" property of ScrollTrigger. For the record, as a user I would HATE it if a site literally prevented me from moving the scrollbar or it stopped responding to my mouse wheel. But maybe I'm weird. 1 Link to comment Share on other sites More sharing options...
Author Share Posted May 14, 2022 It's for your convenience. For example, when you move a window, it sticks to the corner like a magnet. If you scroll down the image, the image will go up straight, and if you pause for about half a second when the image is in the correct position, it will be much easier for the user to fit the image in the correct position. I put a carousel in the middle, but if I scroll, it goes a little too far, so I can't see the top. So that's how I thought about it. Link to comment Share on other sites More sharing options...
Author Share Posted May 14, 2022 I was able to solve the problem by watching the video of the pin part in the DOC you told me.Thank you for your answer. See the Pen VwQmzao by goodcontext (@goodcontext) on CodePen 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