-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Looping Scroll Possible? #85
Comments
It's not really possible with the current architecture. I'll leave this open, though. Maybe someone else has an idea. |
I was working on this until I saw this issue. I've been able to keep track of the translate3D() value, @hew is there a way to now reset the component to its initial translate3D value (e.g: (0, 0, 0))? Have you implemented something that can help us doing this? Thanks for this package and help you can provide, much appreciated. |
Yes there is a way to directly manipulate the translate value, but it causes the scrollwheel to jump around and it makes for a poor user experience. At least that was what happened when I attempted. I think @zachgibson wrapped this library with react-draggable at some point. I think that is the current meta. |
This is a way to proceed but as you said, it creates a glitch that alters a bit the user experience.
|
This looping scroll issue is typically achieved by manipulating the items, not so much the scroll positioning. Something like if (position = maxWidth - item) {
items.push(items[0])
} |
Thanks for the response @hew! Could you expand on the items array and maybe give a more detailed example? Not sure to see how this can be done from this given piece of code. |
It's just pseudo code. But the idea is that you move the first item to the last spot when you reach a certain point. The scroll positioning doesn't change so much as the items in the array change/re-order. This is how I've seen it done with other websites, but I could never nail an implementation that really worked with this library's architecture.
|
Ah I see. Clever. |
Gonna close this for now. I've started on V2. Whether or not I try and implement the above approach, I will try my best to enable a looping option. |
Hi,
Is there way to use this and have it loop infinitely in either direction? Sort of like this website: https://www.kwokyinmak.com/
Appreciate all the help I can get! :)
The text was updated successfully, but these errors were encountered: