0

when first scroll done my header get fix position but my challenge is => scroll is not smooth and change suddenly position

.sticky-part {
  position: fixed;
  z-index: 9999;
  width: 100%;
  background-color: white;
  height: 95px;
}


  scroll = (): void => {
if (window.scrollY == 0) {
  this.isScroll = false;
}
else {
  this.isScroll = true;
}

};

<div class="header-container" [class.sticky-part]="(showMessageBox | async) && !isHome && isScroll"></div>
ahmeticat
  • 1,899
  • 1
  • 13
  • 28
heliya rb
  • 682
  • 8
  • 26
  • maybe this will help you : https://stackoverflow.com/questions/46658522/how-to-smooth-scroll-to-page-anchor-in-angular-4-without-plugins-properly/51400379#51400379 – Joel Joseph Nov 28 '19 at 06:55
  • also please check this article : http://joeljoseph.net/angular-sticky-header-on-scroll/ – Joel Joseph Nov 28 '19 at 06:57

0 Answers0