How to choose one of slides from slidebox?

I want to be able to start on slide index n,
here my code, n here equal to 3

<ion-slide-box selected=3 on-slide-changed="slideHasChanged($index)">
        <ion-slide><img src="img/1.jpg" ></ion-slide>
        <ion-slide><img src="img/2.jpg" ></ion-slide>
        <ion-slide><img src="img/3.jpg" ></ion-slide>
        <ion-slide><img src="img/4.jpg" ></ion-slide>
        <ion-slide><img src="img/5.jpg" ></ion-slide>                                        
</ion-slide-box>

but every time slidebox start from begining !

The code was work correct before I upgrade ionic to v1.0.0-beta.14 “magnesium-mongoose”

when I upgrade to beta 14 , it become gives this result

The attribute should be “active-slide” not ‘selected’.

According to ion slide box docs and check an example

2 Likes

thank you very much @joseadrian it is work now

I see this page https://github.com/driftyco/ionic/blob/v1.0.0-beta.14/CHANGELOG.md#breaking-changes
and I did not expect that there is an error here !

And Breaking Changes

The slideBox’s API has undergone many changes.
attributes have changed (see
documentation)
active-slide has changed to selected. Change your code from
this:

<ion-slide-box active-slide="activeSlideIndex"></ion-slide-box>

To this:

<ion-slide-box selected="activeSlideIndex"></ion-slide-box>

You are right. I haven’t found any issue on github about this and I’m not sure If I should open one.

On the same tag (v1.0.0-beta.14) they have ‘selected’

And ‘active-slide’

1 Like