1

enter image description here

I'd like to do the above app Tutorial effect using Onsen UI. However, in the Page Patterns of Onsen UI, I didn't see anything similar. Could someone shed some light on this?

Much appreciated.

asked Sep 28, 2015 at 4:09

1 Answer 1

6

I think what you're looking for is a carousel. You can make one using the <ons-carousel> component.

In this case you want to have a swipeable fullscreen carousel so you can define it like this:

<ons-carousel swipeable overscrollable auto-scroll fullscreen>
 <ons-carousel-item>
 Content #1
 </ons-carousel-item>
 <ons-carousel-item>
 Content #2
 </ons-carousel-item>
</ons-carousel>

Here is a simple example of a fullscreen carousel: http://codepen.io/onsen/pen/xbbzOQ

Please also take a look at the docs: http://onsen.io/reference/ons-carousel.html

If you want bullets, you can use the carousel.getActiveCarouselItemIndex() in order to get the current active element.

<ons-carousel-cover>
 <div class="bullets">
 <span 
 ng-repeat="idx in indices"
 ng-class="{'active': idx === carousel.getActiveCarouselItemIndex()}">
 •
 </span>
 </div>
</ons-carousel-cover>

You also need to trigger a digest event to make Angular understand that something changed.

This is the code: http://codepen.io/argelius/pen/RWomrz

answered Sep 28, 2015 at 5:38
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks a lot, Andreas! btw, could you give me a hint about the progress bar (several white spots) when swiping the carousel? Much appreciated.
Do you mean something like this? codepen.io/argelius/pen/RWomrz I will add it to the answer.
OMG, this is it! You really save my day!

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.