Skip to content

Instantly share code, notes, and snippets.

@keysona
Created October 18, 2016 12:58
Show Gist options
  • Select an option

  • Save keysona/9515cbcc365b7708c34b3d64d946ea23 to your computer and use it in GitHub Desktop.

Select an option

Save keysona/9515cbcc365b7708c34b3d64d946ea23 to your computer and use it in GitHub Desktop.
Ionic2-Slides-创造图片滑动栏
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
@Component({
selector: 'page-component',
templateUrl: `
<ion-header>
<ion-navbar>
<ion-title text-center>
Text
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-slides [options]="mySlideOptions">
<ion-slide style="background-color: #2196F3">Blue</ion-slide>
<ion-slide style="background-color: #3F51B5">Indigo</ion-slide>
<ion-slide style="background-color: #673AB7">Deep Purple</ion-slide>
</ion-slides>
</ion-content>
`
})
export class HomePage {
mySlideOptions = {
pager: true,
initialSlide: 0,
autoplay: 1000, // 1000 代表播放间隔是1秒。以毫秒为单位。
loop: true
};
constructor(public navCtrl: NavController) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment