Can I use <ons-carousel> as a slider??

  • hey @Fran-Diox can I use <ons-carousel> tag for my slider and can it slide automatically??

  • Onsen UI

    @Gaurav You can simply use setInterval and increase the carousel index. Currently, the carousel has no “infinite” swipe, meaning that once it reaches its last index you need to reset it to 0. Something as simple as setting the index to ++index%length should work.

  • @Fran-Diox thanks for reply but I want <ons-carousel> just for scrolling images and other components below <ons-carousel> so can I write those components

  • Onsen UI

    @Gaurav If you don’t provide the fullscreen attribute it won’t cover everything, so I think you can do what you want.

  • @Fran-Diox ooh thank you

Log in to reply