2016-11-30 88 views
0

所以,这是CSSFirefox的过渡不工作

html { 
background: url(Images/1.jpg); 
background-position: center; 
background-size: cover; 
-webkit-transition: background 1s ease; 
-moz-transition: background 1.5s ease; 
transition: background 1s ease; 
-webkit-transform: translateZ(0); 
-moz-transform: translateZ(0); 

}

我有jQuery的代码,每次你按下空格键时,背景:网址(X/x.jpg)的变化。

它在谷歌浏览器上完美运行,但是,一旦在Firefox中它突然变化。您可以看到默认值已设置,-moz前缀显然存在。

我已经搜遍了,但我只看到答案说包括一个默认值。

+0

这已经在SO上讨论过了,例如http://stackoverflow.com/questions/7319552/can-i-fade-in-a-background-image-css-background-image-with-jquery和http ://stackoverflow.com/questions/9483364/css3-background-image-transition –

回答

2

background-image不是animatable property。它可能在Chrome中受到支持,但它不符合规范,不能保证在所有浏览器中都能正常运行。您可能需要查看基于JavaScript的图像幻灯片插件。