Replies: 2 comments 3 replies
-
Hi @rd-xx, Thanks for your question. I just want to clarify—are you looking to use percentages |
Beta Was this translation helpful? Give feedback.
-
Hi David, yes that's it. Maybe it wasn't clear enough and I apologize for that. If you watch the little video I made, you'll see that when I click on the slider, the white bar (which I get from Ultimately, what I want if for the bar to stop exactly where I clicked on the slider, and I think that would be the case if I could set the scroll progress in % instead of the slide index. If you think this is not the right approach, please let me know. Thank you :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hi. I'm trying to create a slider which updates the scroll position of the carousel in % but didn't find anything to get this done in the current version (8.6.0).
I found an example that more or less shows what I'm trying to achieve, however, it's only for showing the scroll position (https://www.embla-carousel.com/examples/predefined/#progress. What I want is have that slider be clickable so it updates the scroll position.
I tried using
emblaApi.scrollTo()
(which requires the slide index), but as it sets the scroll position to the start of the slide, the slider it not set where the user clicked. It either stops a little before, or after.CleanShot.2025-04-09.at.16.31.44.mp4
I came across #23 and #26 but none of them where of help. I think the methods mentioned there are from older versions of the library, that didn't made the newer versions. Maybe because there's a new way of doing this that I'm not aware of?
If applicable, which variants of Embla Carousel are relevant to this question?
Additional information
Using version 8.6.0
CodeSandbox example
No response
Beta Was this translation helpful? Give feedback.
All reactions