首页 > 解决方案 > 添加修复类时的角度平滑滚动

问题描述

当第一次滚动完成时,我的标题得到固定位置,但我的挑战是 => 滚动不平滑并突然改变位置

.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>

标签: cssangular

解决方案


推荐阅读