可能的重复:
jQuery + RGBA颜色动画

嘿,

我想改变悬停的RGBA价值的不透明度,但是不透明度保持在.07 ..也许OU可以帮助我找到错误。

CSS(即hacks在单独的文件中 - 无需在这里提及它们)

.boxcaption{
   float: left;
   position: absolute;
   height: 100px;
   width: 100%;
   background: rgb(255, 144, 11);
   background: rgba(255, 144, 11, 0.7);
}

JS

var thumbslide = $('.boxgrid.captionfull').click(function() {
    $('.boxgrid.captionfull.clicked').removeClass('clicked').children('.cover').stop().animate({top: 230, background: 'rgba(255, 144, 11, 0.7)'}, 350);
    $(this).toggleClass('clicked').children('.cover').stop().animate({top: 0, height:"230px", background: 'rgba(255, 144, 11, 1)'}, 350);
});
有帮助吗?

解决方案

jQuery颜色插件不支持RGBA。而是使用此: 链接文字

其他提示

我得到了感觉(未经测试 猜测),jQuery没有检查CSS背景属性的 rbga(...) 因此不应用黑客修复来更改 filter:alpha().

我想你需要改变 opacity:1 分别地。

.animate({top:0,height:"230px",background:'rgb(255, 144, 11)',opacity:1}, 350);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top