【问题标题】:Chrome page jumpes/flickering when hidden content showing and scroll down隐藏内容显示并向下滚动时,Chrome 页面会跳转/闪烁
【发布时间】:2021-01-12 00:50:26
【问题描述】:

我有这样的布局:

<div class="fixed scroll"> //div with position fixed and scroll
  <div class="item"></div>
  <div class="item"></div>
  <div class="item hover"> //div on hover showing hidden
    <div class="hidden"></div>
  </div>
</div>

问题是当悬停最后一个 div 并在显示隐藏 div 时向下滚动时,页面开始跳跃/闪烁(仅在 google chrome 中)。

codepen上显示问题

【问题讨论】:

    标签: html css google-chrome


    【解决方案1】:

    解决方法是为div添加固定和滚动样式

    overflow-anchor: none;
    

    codepen

    mdn上查看更多信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-25
      • 1970-01-01
      相关资源
      最近更新 更多