2013-12-12 26 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 。直到 广泛支持抵达这可以通过图像精灵伪造和 背景位置或不透明度。要生成渐变效果,它们必须是 相同类型。“