404
Views
4
Comments
[Silk UI Web] Carousel: How to initially navigate to an element?
Question
silk-ui-web
Web icon
Forge asset by OutSystems

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?


Tks

2021-02-26 15-02-11
Dinis Carvalho
Staff
2019-11-05 13-49-23
Miguel Monteiro
Staff

Hi,

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?


Tks



2021-02-26 15-02-11
Dinis Carvalho
Staff

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.

2019-11-05 13-49-23
Miguel Monteiro
Staff

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. 

Thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.