gpt4 book ai didi

javascript - 如何修复滞后的背景附件 :fixed in Safari?

转载 作者:行者123 更新时间:2023-11-28 05:30:34 25 4
gpt4 key购买 nike

麻烦:我在现场有几个视差 block ,这是其中之一:

<section data-original="img/purity.jpg" class="special-soft lazy module parallax parallax-window_2 cf"
id="quality">
<div class="special-soft__text cf">
<span class="f_left">01</span>
<h2 class="f_left">ОСОБЛИВА М'ЯКІСТЬ</h2>
<hr class="f_left">
<p class="f_left">
Особливість м'якого смаку класичної горілки Medoff досягається завдяки унікальній технології фільтрації
«медовий дощ». Смак напою дозріває під впливом мікрочастинок меду, який вважається кращим природним
фільтром
</p>
</div>
</section>

section.special-soft {
position: relative;
height: 722px;
background: url("../img/purity.jpg") no-repeat scroll center;
background-size: cover;
text-align: center;
background-position: center center;
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
-webkit-transition: background-image 0.4s;
-moz-transition: background-image 0.4s;
-ms-transition: background-image 0.4s;
-o-transition: background-image 0.4s;
transition: background-image 0.4s;
overflow: hidden;
-webkit-font-smoothing: subpixel-antialiased;
}

在 Firefox 和 Chrome 中工作正常,但在 Safari 中我变得滞后了

问题:我该如何解决?我需要在 Safari 中获得更好的性能

JSFIDDLE:https://jsfiddle.net/z7b0fsx9/

谢谢

最佳答案

尝试隔离导致 Safari 和其他浏览器之间性能差异的 CSS 属性。一种方法是注释掉一个或多个“section.special-soft”CSS 类属性。我将从 -webkit-font-smoothing 属性开始。

此外,考虑至少将一些“特殊软”CSS 类属性应用到封闭的 div 标签而不是 section 标签。 section 标签是 HTML5 新增的,但 div 标签在 HTML5 之前就已经存在。

关于javascript - 如何修复滞后的背景附件 :fixed in Safari?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38528510/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com