使用jquery改变rgba alpha透明度
可能的重复:
jQuery + RGBA 颜色动画
嘿,
我想更改悬停时 rgba 值的不透明度,但不透明度保持在 0.07..也许你可以帮我找到错误。
CSS(IE 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);
});
Possible Duplicate:
jQuery + RGBA color animations
hey,
i want to change the opacity of an rgba value on hover, but the opacity stays at .07.. maybe ou can help me find the mistake.
CSS (IE hacks are in seperate file - no need to mention them here)
.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);
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我感觉(未经测试猜测)jQuery 没有检查
rbga(...)
的 CSS 背景属性,因此没有应用黑客修复以更改filter:alpha()
。我认为您需要单独更改
opacity:1
。I get the feeling (untested guess) that jQuery is not checking the CSS background property for
rbga(...)
and thus not applying a hack fix to change thefilter:alpha()
.I think you'll need to change
opacity:1
separately.jquery颜色插件不支持rgba。请使用以下内容:链接文本
the jquery color plugin doesn't support rgba. use this instead: link text