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

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

Forge Component
Published on 2017-12-20 by OutSystems R&D
57 votes
Published on 2017-12-20 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?



You can use the Owl Carousel API to achieve that behavior :)



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.