简体   繁体   English

Stellar.js视差元素在Safari上不稳定吗?

[英]Stellar.js parallax elements are jittery on Safari?

I know this question has been asked before, but I have tried making the background images fixed and it doesn't help. 我知道之前曾有人问过这个问题,但我尝试过固定背景图片,但没有帮助。

You can view the problem here when you scroll down to the thumbnail gallery. 向下滚动到缩略图库时,可以在此处查看问题。

I really don't know what the problem is, but here is the code for the backgrounds that are jittery: 我真的不知道问题出在哪里,但是下面是令人不安的背景代码:

#content1 {
  background: #395668 url(../img/studio-9.jpg) fixed no-repeat center;
  padding-top: 120px;
  padding-bottom: 120px;
}

#gallery {
  background: url(../img/studio-8.jpg) fixed no-repeat center;
  padding-top: 160px;
  padding-bottom: 160px;
}

Any clue what's happening?? 有什么线索吗? Looks fine in Chrome and decent in Firefox. 在Chrome中看起来不错,在Firefox中看起来不错。

This unfortunately isn't to do with your coding, but rather the browsers themselves, as Safari reacts to mouse scrolling very differently to Firefox and Chrome. 不幸的是,这与您的编码无关,而是浏览器本身,因为Safari对鼠标滚动的反应与Firefox和Chrome完全不同。

Firefox and Chrome track mouse scrolling throughout the scrolling process, which is what makes the Parallax effective. Firefox和Chrome浏览器在整个滚动过程中跟踪鼠标的滚动,这就是使Parallax有效的原因。

However, with Safari, mouse scroll position isn't updated until the user has finished scrolling, which is what causes the jittery effect. 但是,使用Safari时,直到用户完成滚动时,鼠标滚动位置才会更新,这会引起抖动效果。

The only option is to disable the Parallax effect for Safari users. 唯一的选择是为Safari用户禁用视差效果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM