2013-12-12 25 views
0

在此處輸入代碼背景轉換不工作,沒有到IMG公司CSS

嗨,大家好,我想平穩過渡,有0.4 5S,從BG沒有一個背景圖片得好,應該有辦法。 ..

我嘗試以下操作:

` 


>.content { /*class in div id topcontent */ 
>>position: relative; 

>>padding-top: 1150px; 

>>width: 900px; 
>>margin: 0px auto 0px auto; 

>>z-index:1; 

>>-webkit-transition: all 0.9s ease; 
>>transition: all 0.9s ease; 

>} 

>.gobg { /* the bg class */ 
>>background: url(../images/gradientwhitelow.png) center repeat-y; 

>>-webkit-transition: all 0.9s ease; 

>>transition: all 0.9s ease; 

>} 

and js 


><script> 
>>if ($(window).scrollTop() > 690){ 
     $("#topcontent").toggleClass("gobg", true); 
>>}</script> 

`

任何提示?

謝謝!

我糾正了JS,撥錯碼

+0

什麼是在您的CSS代碼中的」>>「?我們可以有一些HTML嗎? – davidpauljunior

回答

0

看看這個表動畫屬性...

http://oli.jp/2010/css-animatable-properties/#background-image

你會注意到背景圖像具有小標2.檢查出底部的那部分和閱讀:

「雖然CSS背景和邊框模塊級別3編輯草稿說 」動畫:否「爲背景圖像在寫作時,支持 CSS中的淡入淡出圖像出現在Chrome 19 Canary 。直到 廣泛支持抵達這可以通過圖像精靈僞造和 背景位置或不透明度。要生成漸變效果,它們必須是 相同類型。「