-
-
Notifications
You must be signed in to change notification settings - Fork 209
[Feat]: Repeat items if necessary to achieve infinite scroll #124
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
Comments
Hello Robin (@openscript), Thank you for your feature request. At the moment, Embla has a built-in functionality that falls back to I guess when setting up the ticker you requested (in issue #114), I re-created the internal carousel loop so it doesn't respect the fallback. So you'll have to add clones yourself. You can do this by checking if there are enough slides to loop like so: emblaApi.internalEngine().slideLooper.canLoop() // returns --> boolean ...or maybe not scroll at all if there aren't enough to items to loop? Because users will see duplicates and I'm not sure that makes sense? I hope this helps. Kindly, |
Hello David Thank you so much for the quick response. That's a great hint with After all, when I want to fill up the empty space with items, I need to know how wide all items are as well as the whole slider. With the possibility that the user resized the window it becomes quite complicated. I understand now, that this is tricky to implement within embla. I think I won't scroll if there aren't enough items as you suggested. Thank you again! :) Robin |
Hi Robin (@openscript), Thanks a lot for understanding! Kindly, |
Hello everybody
Based on #114 I could implement a continuously running slider. When the slider is too wide or there are not enough items, to fill the whole width the slider becomes buggy.
I've created a Sandbox here. Here is a little clip about, which shows the problem:
If I fill the whole visible width with items it works fine. Would it be easy to implement a feature within embla, which at least fills the visible width? .. because even if it isn't buggy, I want to fill the whole width for a nice appearance.
Thank you in advance!
The text was updated successfully, but these errors were encountered: