为什么文本/按钮跳转页面加载(Chrome)

Why are text/buttons jumping around on page load (Chrome)?

本文关键字:加载 Chrome 文本 按钮 为什么      更新时间:2023-09-26

请访问我们的主页http://froy.com。

在页面加载的前半秒内,您可以看到"商店"按钮以及按钮上方的文本出现在屏幕左侧附近。当页面加载完成后,它们会移动到合适的位置。

这个问题似乎只发生在Chrome上。我们的网站是响应。

理想情况下,我们希望网站加载就像http://ae.com。他们在主页文本和按钮上使用了类似的布局,但他们都能正常加载。

我不介意视频最后加载,当视频出现时所有东西都往下移动,但我发现文本/按钮从左到右移动非常不专业。

这些按钮应该不是问题,如果视频没有渲染,它们就在它们应该在的位置。
当它呈现时,它们应该是好的。

我会看看你的视频和视频容器。也许可以尝试将.slideshow-video-container CSS规则更改为:

.slideshow-video-container {
    position: relative;
    padding-top: 25px;
    overflow: hidden;
}

我建议你用覆盖元素隐藏整个页面,只有在所有内容加载后,才淡出该元素。这应该解决大部分或所有的渲染问题。下面是一个例子:

$(function(){
  $('#overlay').fadeOut();
})
div#content{
  width:50%;
  margin:auto;
  p{
    margin:2rem;
    padding:0;
  }
}
div#overlay{
  position:fixed;
  top:0;left:0;right:0;bottom:0;
  background:#fff;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id=content>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
  <p>Authoritatively build effective networks rather than transparent ideas. Monotonectally pontificate high-quality content whereas world-class schemas. Distinctively leverage other's distributed scenarios vis-a-vis synergistic applications. Proactively implement bricks-and-clicks.</p>
</div>
<div id=overlay></div>