Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ionic Slide Box

ionic Slide Box


ion-slide-box

A slide box is a component containing a multi-page container, with each page switched by swiping or dragging:

The effect is shown below:

Usage





  

    

BLUE

YELLOW

PINK

API

property Type Details
delegate-handle

(optional)

| `string` |

This handle uses$ionicSlideBoxDelegateto identify this slide box.

| | does-continue
(optional)
| `boolean` |

Whether the slide box enables loop scrolling.

| | auto-play
(optional)
| `boolean` |

Set whether the slide box plays in a loop; if does-continue is true, the default is also true.

| | slide-interval
(optional)
| `number` |

How many milliseconds to wait before starting to slide (if continue is true). Default is 4000.

| | show-pager
(optional)
| `boolean` |

Whether the slide box's pager is shown.

| | pager-click
(optional)
| `expression` |

When a page is tapped, this expression is triggered (if shou-pager is true). Passes an 'index' variable.

| | on-slide-changed
(optional)
| `expression` |

When sliding, this expression is triggered. Passes an 'index' variable.

| | active-slide
(optional)
| `expression` |

Bind the model to the current slide box.

|

Example

HTML Code





    

      

BLUE

    
         

YELLOW

    
         

PINK

    

CSS code



.slider {

  height: 100%;

}

.slider-slide {

  color: #000; 

  background-color: #fff; text-align: center; 

  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-weight: 300; }

.blue {

  background-color: blue;

}



.yellow {

  background-color: yellow;

}



.pink {

  background-color: pink;

}

.box{ 

  height:100%; 

} 

.box h1{

  position:relative; top:50%; transform:translateY(-50%); 

}

JavaScript Code



angular.module('ionicApp', ['ionic'])



.controller('SlideController', function($scope) {

  

  $scope.myActiveSlide = 1;

  

})