2016-11-30 83 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的圖像幻燈片插件。