Css Chrome34中的动画

Css Chrome34中的动画,css,google-chrome,css-animations,Css,Google Chrome,Css Animations,不久前,我使用这里的一个片段创建了一个无限滚动的元素 我在网站上使用的活动代码如下所示: .wave_bg { background: url("../img/wave_bg.jpg") no-repeat; -webkit-animation: slide 10s linear infinite; -moz-animation: slide 10s linear infinite; -ms-animation: slide 10s linear infinite; anim

不久前,我使用这里的一个片段创建了一个无限滚动的元素

我在网站上使用的活动代码如下所示:

.wave_bg {
  background: url("../img/wave_bg.jpg") no-repeat;
  -webkit-animation: slide 10s linear infinite;
  -moz-animation: slide 10s linear infinite;
  -ms-animation: slide 10s linear infinite;
  animation: slide 10s linear infinite;
}

  @-webkit-keyframes slide {
    from {
      background-position: 0 0;
    }
    to {
      background-position: 100% 0;
    }
  }
  @-moz-keyframes slide {
    from {
      background: left;
    }
    to {
      background: right;
    }
  }
  @-ms-keyframes slide {
    from {
      background: left;
    }
    to {
      background: right;
    }
  }
  @keyframes slide {
    from {
      background: left;
    }
    to {
      background: right;
    }
  }
然而,在Chrome34中,它突然停止工作(它在Chrome33和更早版本中工作)-背景图像根本不出现(它在FF 33.1、FF 35.0.1、FF 38.0.5和IE 10中仍然工作)。如果我在dev工具中禁用了动画(以及不推荐使用的webkit动画),那么背景图像将再次显示,因此我假设问题与CSS动画有关


我找不到(快速搜索)任何关于Chrome 34中动画变化的文档,所以我想知道是否有人遇到过这个错误,并有一些解决方法?

我没有看过你的代码。。但是随着Chrome删除越来越多的前缀,如果您仅在
-webkit动画中使用
-webkit动画:无限…
前缀,则某些动画可能无法工作

确保在Delcare动画中同时使用前缀和非前缀语法。见下文

你需要这个

@-webkit-keyframes infnite {
    0%   { -webkit-transform: scale(1); transform: scale(1);}
    100% { -webkit-transform: scale(2); transform: scale(1);}
}
还有这个…

@keyframes infnite {
    0%   { -webkit-transform: scale(1); transform: scale(1);}
    100% { -webkit-transform: scale(2); transform: scale(1);}
}

在上面的例子中。。。如果Chrome放弃了对
transform
前缀的支持,但不支持
关键帧
,那么除非您同时拥有前缀和unprefix,否则动画将“突然”停止工作

上面问题中的代码段是网站上使用的CSS,包含前缀和非前缀版本。FWIW chrome确实可以识别前缀版本,因为我需要取消选中动画和-webkit动画,以便背景图像“重新出现”,您是否可以实际提供代码。没有它就很难诊断,因为你在CSS技巧上展示的示例不符合我所说的。我有-这是stackoverflow问题本身中的代码片段:)没有。。您尚未包含动画。只有对动画的调用。对不起,我一定是第一次误读了,或者现在添加了:/