Imprimer

Code Js

import { Component, ViewChild } from '@angular/core';
import { Content } from 'ionic-angular';

@Component({...})
export class MyPage{
  @ViewChild(Content) content: Content;
  public scrollPost: number = 0;

  getScrollTop() {
    this.scrollPost = this.content.scrollTop;
  }
}

Code HTML:

<ion-content (ionScroll)="getScrollTop()">
  <!-- your page content -->
</ion-content>




Source : https://stackoverflow.com/questions/52385472/document-scrolltop-coming-0-in-ionic
Affichages : 1390