rcbyr / keen-slider

The HTML touch slider carousel with the most native feeling you will get.
https://keen-slider.io/
MIT License
4.67k stars 214 forks source link

Scrolling to a Specific Element in a Multi-Element Slide #417

Open kowalczyk-mateusz opened 5 months ago

kowalczyk-mateusz commented 5 months ago

I have a navigation system that includes multiple elements. I've set 'auto' for the perView option. When the URL changes, I would like the slider to move to the current element in the navigation. I'm not sure how to do this because moveToIdx takes the index of the given slide, but currently I have several elements fitting on one slide. The moveToIdx function with the absolute parameter is not working for me. Is there a way to scroll the element but to the index of the element from the array that was passed?