项目作者: pengkobe

项目描述 :
marquee effect for ionic
高级语言: TypeScript
项目地址: git://github.com/pengkobe/ionic-marquee.git
创建时间: 2018-04-21T03:52:03Z
项目社区:https://github.com/pengkobe/ionic-marquee

开源协议:MIT License

下载


ionic-marquee

Dependency Status
NPM version Downloads MIT License

NPM

marquee effect for ionic

Install

npm install ionic-marquee --save

Usage

import the module:

  1. ...
  2. import {IonMarqueeModule} from "ionic-marquee";
  3. @NgModule({
  4. ...
  5. imports: [
  6. IonMarqueeModule,
  7. ...
  8. ],
  9. ...
  10. })
  11. export class AppModule {}

Example

Horizontal Animation

Only support inline text scroll
``typescript export class YourPage implements OnInit { horizontalText =this is the text to show scroll horizontal,
and default is scroll horizontal. you don’t need to set the direction`;
constructor(public navCtrl: NavController) {}

ngOnInit() {
setTimeout(() => {
this.horizontalText = this is the text to show that text could be refreshed. but this feature support horizontal scroll only!;
}, 5000);
}
}

  1. ```html
  2. <ion-marquee speed="30" style="height: 24px" [text]="horizontalText">
  3. </ion-marquee>

Vertical Animation

  1. export class YourPage {
  2. direction = 'vertical';
  3. constructor(public navCtrl: NavController) {}
  4. }
  1. <ion-marquee [speed]="30" [direction]="direction" style="height:122px">
  2. <ul>
  3. <li>1</li>
  4. <li>2</li>
  5. <li>3</li>
  6. <li>3</li>
  7. <li>5</li>
  8. <li>6</li>
  9. </ul>
  10. </ion-marquee>

API

Input

Name Type Description
speed Number the animation speed
direction String the animation direction. default is horizontal. you can also set to vertical
text String horizontal scroll text

Lincese

MIT@yipeng.info