简体   繁体   English

在 Chrome 页面上使用动画时出现奇怪的背景故障

[英]Weird background glitch when using animation on the page in Chrome

If i have an animated element followed by another non-animated element, banding effect and various color shifting bugs appear in Chrome.如果我有一个动画元素,然后是另一个非动画元素,Chrome 中会出现条带效果和各种颜色偏移错误。 Hard to see, but i recorded a video(if you zoom in on the page, the color shifts, easier to see): https://d26dzxoao6i3hh.cloudfront.net/items/1w1k2e3v0g04142U2A3H/Screen%20Recording%202017-10-30%20at%2011.35%20PM.mov很难看,但我录制了一个视频(如果放大页面,颜色会发生变化,更容易看到): https : //d26dzxoao6i3hh.cloudfront.net/items/1w1k2e3v0g04142U2A3H/Screen%20Recording%202017-10-30 %20at%2011.35%20PM.mov

 header { height: 100vh; display: flex; align-items: center; justify-content: center; background: #263238; } header a { animation: scroll-down-anim 1s infinite; } @keyframes scroll-down-anim { 0% { transform: translateY(0); } 100% { transform: translateY(10px); } }
 <header> <a href="#">Animated element</a> </header> <p>if i remove this, the glitch disappears</p>

Any ideas how to fix this?任何想法如何解决这一问题? If i remove the <p> element, it works.如果我删除<p>元素,它会起作用。 Also works on any other browser, like Safari.也适用于任何其他浏览器,如 Safari。

Well this actually works for me, so I strongly suspect that it's just your graphics card or version of Chrome that's having issues.嗯,这实际上对我有用,所以我强烈怀疑这只是你的显卡或 Chrome 版本有问题。

However I would suggest that the reason it's happening is that the translate style forces Chrome to render using the GPU and having the P tag there is giving it a hard time.但是,我认为发生这种情况的原因是translate样式强制 Chrome 使用 GPU 进行渲染,并且在那里放置 P 标签会造成困难。

If you were to force the P tag to use the same translation too then that might fix the issue for you, like this:如果您也强制 P 标签使用相同的翻译,那么这可能会为您解决问题,如下所示:

p {
    transform: translateY(0);
  }

it has nothing to do with chrome or your codes它与 chrome 或您的代码无关

Its your gpu !它是你的 GPU! specially if you have am series Gpu (laptop to be exact)特别是如果您有 am 系列 Gpu(准确地说是笔记本电脑)

so what happens is when you're using a ratio or a resolution higher or lower than your monitors native settings you put too much pressure on the gpu !因此,当您使用的比率或分辨率高于或低于您的显示器本机设置时,您会对 gpu 施加太大压力!

Update your graphics software by the os itself or bring the resolution back to its factory resolution通过操作系统本身更新您的图形软件或将分辨率恢复到出厂分辨率

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

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