Ionic 3 Css does not work when navigate to reading page second time

#1

reading.html:

 
reading.ts: ngOnInit() { this.content.ionScrollEnd.subscribe((data)=>{
  let dimensions = this.content.getContentDimensions();
  let scrollTop = this.content.scrollTop;
  let contentHeight = dimensions.contentHeight;
  let scrollHeight = dimensions.scrollHeight;

  if ( (scrollTop + contentHeight + 20) > scrollHeight) {
   console.log("hi");
  
    $("#segment").css("display","none");
    $("#scrolltop").css("display","block");
    
    
  }
  
   else {
    console.log("up");
  }

});

}



first time its work great but scond time manu did not hide