我在7.1 SquareSpace网站上的代码注入(页脚)中添加了视差javascript代码。但是,现在,当您转到站点上具有视差效果的任何页面时,都会在加载图像之前先加载背景色。有没有人曾经经历过这种情况或对如何消除颜色有任何建议?我希望首先加载实际图像,而不是蓝色。或某种解决方法,因此它并不引人注意。
One of the web pages that has the color loading before the image
我正在使用的Javascript代码:
< script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" > < /script> <
script src = "https://cdn.jsdelivr.net/npm/[email protected]/scrollax.min.js" > < /script> <
script >
$('.has-background').attr('data-scrollax-parent', 'true');
$('.section-background').attr('data-scrollax', 'properties: { translateY: "30%" }');
$.Scrollax(); <
/script>
<style>.has-background {
overflow: hidden;
}
</style>
任何建议,将不胜感激!谢谢!
通常来说,图像总是在页面其余部分之后加载。但是,您可以将栏目的背景颜色设置为与网站背景(白色)匹配,以使其不太明显。如果无法在样式和部分设置中设置部分背景颜色,则以下CSS(通过the CSS Editor/Custom CSS插入)应该可以解决问题:
:not(.has-background) .section-background {
background-color: white;
}
.page-section.has-background.black-bold .section-background-overlay {
background-color: white !important;
}