1
votes

I'm trying to have a slide-box whenever you swipe to the left it go to next slide and when you swipe to the right it go back to previous page. I follow the instruction on Ionic website but it can not swipe to any direction. Here my code:

Html

<body ng-app="myApp" ng-controller="myCtrl">
   <ion-header-bar class="bar-stable">
     <h1 class="title">Test Starter</h1>
  </ion-header-bar>
   <ion-content style="color:grey;">
        <ion-slide-box>
            <ion-slide>
                <div>
                    "Hello slide 1"

                </div>
            </ion-slide>
            <ion-slide>
                <div>
                    "Hello slide 2"
                </div>
            </ion-slide>
        </ion-slide-box>
  </ion-content>
1

1 Answers

0
votes

ion-slide only works when you swipe through the content.

Replace your code with this

<ion-slide>
  <div class="slide">
   <p>Hello slide 1</p>
  </div>
</ion-slide>

<ion-slide>
   <div class="slide">
    <p>Hello slide 2</p>
   </div>
</ion-slide>

In style.css

  .slide{
  height:100vh;}