[Silk UI Web] Carousel: How to initially navigate to an element?

Forge Component
Published on 25 Mar (4 weeks ago) by OutSystems R&D
79 votes
Published on 25 Mar (4 weeks ago) by OutSystems R&D

Hi guys,

I would like to know how to navigate to the X-th element of the carousel.

I'm trying to use jquery scrollLeft but, after that, the scroll gets all messed up. Any easy way?



Correct me if I'm wrong but I can simulate the navigation clicks, with the goTo function, but the pace depends on the screen size which turns difficult to have it working on a generic way.

Do you see any other way?


The pace? You mean the speed of the transition? It will depend on the screen size but should not be noticeable if the gap is not too big. Using the default 300-500 should be enough.

Sorry, I didn't explain myself clearly. The API doesn't help because it only allows me to "click" on the navigation arrows and, since the right and left movement "width" depends on the screen resolution, it's quite hard to automatically navigate to the desired element.

Nevertheless, I've solved this using the same mechanism of owl, which is a css transaction on x-axis.